2023-04-22 23:42:08 +03:30

42 lines
1.2 KiB
JavaScript

/*
* APIs
* An example application with OpenAPI, Swashbuckle, and API versioning.
*
* OpenAPI spec version: 1.0
* Contact:
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://github.com/OpenAPITools/openapi-generator
*
* OpenAPI generator version: 6.6.0-SNAPSHOT
*/
import http from "k6/http";
import { group, check, sleep } from "k6";
const BASE_URL = "/";
// Sleep duration between successive requests.
// You might want to edit the value of this variable or remove calls to the sleep function on the script.
const SLEEP_DURATION = 0.1;
// Global variables should be initialized.
export default function() {
group("/api/v1/booking", () => {
// Request No. 1: CreateBooking
{
let url = BASE_URL + `/api/v1/booking`;
// TODO: edit the parameters of the request body.
let body = {"passengerId": "uuid", "flightId": "uuid", "description": "string"};
let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}};
let request = http.post(url, JSON.stringify(body), params);
check(request, {
"Success": (r) => r.status === 200
});
}
});
}