diff --git a/modules/swagger-codegen/src/main/resources/scala-gatling/api.mustache b/modules/swagger-codegen/src/main/resources/scala-gatling/api.mustache index 09ca1261324..15c96e383b1 100644 --- a/modules/swagger-codegen/src/main/resources/scala-gatling/api.mustache +++ b/modules/swagger-codegen/src/main/resources/scala-gatling/api.mustache @@ -15,10 +15,12 @@ class {{classname}}Simulation extends Simulation { def getCurrentDirectory = new File("").getAbsolutePath def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + def userConfDirectory = getCurrentDirectory + "/src/gatling/resources/conf" // basic test setup val configName = System.getProperty("testConfig", "baseline") - val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val config = ConfigFactory.parseFile(new File(userConfDirectory + File.separator + configName + ".conf")) + .withFallback(ConfigFactory.parseFile(new File(userConfDirectory + File.separator + "default.conf"))) val durationSeconds = config.getInt("performance.durationSeconds") val rampUpSeconds = config.getInt("performance.rampUpSeconds") val rampDownSeconds = config.getInt("performance.rampDownSeconds") @@ -42,7 +44,7 @@ class {{classname}}Simulation extends Simulation { // Setup http protocol configuration val httpConf = http - .baseURL("{{basePath}}") + .baseUrl("{{basePath}}") .doNotTrackHeader("1") .acceptLanguageHeader("en-US,en;q=0.5") .acceptEncodingHeader("gzip, deflate") @@ -51,7 +53,7 @@ class {{classname}}Simulation extends Simulation { .contentTypeHeader(contentTypeHeader) // set authorization header if it has been modified from config - if(!authentication.equals("~MANUAL_ENTRY")){ + if(!authentication.equals("~MANUAL_ENTRY~")){ httpConf.authorizationHeader(authentication) } diff --git a/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION b/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION index 017674fb59d..a4533be7fa8 100644 --- a/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION +++ b/samples/client/petstore/scala-gatling/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.11-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv index 9c23144ca97..008019ef2a6 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/addPet-BodyParams.csv @@ -1 +1 @@ -photoUrls,name,id,category,tags,status \ No newline at end of file +tags,id,category,status,name,photoUrls \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv index 38dcc63f020..b888f65647d 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/createUser-BodyParams.csv @@ -1 +1 @@ -firstName,lastName,password,userStatus,phone,id,email,username \ No newline at end of file +id,lastName,phone,username,email,userStatus,firstName,password \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv index a2fe128b281..b291d54868a 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/placeOrder-BodyParams.csv @@ -1 +1 @@ -petId,quantity,id,shipDate,complete,status \ No newline at end of file +id,petId,complete,status,quantity,shipDate \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv index 9c23144ca97..008019ef2a6 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updatePet-BodyParams.csv @@ -1 +1 @@ -photoUrls,name,id,category,tags,status \ No newline at end of file +tags,id,category,status,name,photoUrls \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv index 38dcc63f020..b888f65647d 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/updateUser-BodyParams.csv @@ -1 +1 @@ -firstName,lastName,password,userStatus,phone,id,email,username \ No newline at end of file +id,lastName,phone,username,email,userStatus,firstName,password \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv b/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv index 50f9afc8d6c..a8f6bfaf688 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv +++ b/samples/client/petstore/scala-gatling/src/gatling/resources/data/uploadFile-formParams.csv @@ -1 +1 @@ -file,additionalMetadata \ No newline at end of file +additionalMetadata,file \ No newline at end of file diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala index 5e349cc2b6d..f70ce769b01 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/PetApiSimulation.scala @@ -15,10 +15,12 @@ class PetApiSimulation extends Simulation { def getCurrentDirectory = new File("").getAbsolutePath def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + def userConfDirectory = getCurrentDirectory + "/src/gatling/resources/conf" // basic test setup val configName = System.getProperty("testConfig", "baseline") - val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val config = ConfigFactory.parseFile(new File(userConfDirectory + File.separator + configName + ".conf")) + .withFallback(ConfigFactory.parseFile(new File(userConfDirectory + File.separator + "default.conf"))) val durationSeconds = config.getInt("performance.durationSeconds") val rampUpSeconds = config.getInt("performance.rampUpSeconds") val rampDownSeconds = config.getInt("performance.rampDownSeconds") @@ -42,7 +44,7 @@ class PetApiSimulation extends Simulation { // Setup http protocol configuration val httpConf = http - .baseURL("http://petstore.swagger.io/v2") + .baseUrl("http://petstore.swagger.io/v2") .doNotTrackHeader("1") .acceptLanguageHeader("en-US,en;q=0.5") .acceptEncodingHeader("gzip, deflate") @@ -51,7 +53,7 @@ class PetApiSimulation extends Simulation { .contentTypeHeader(contentTypeHeader) // set authorization header if it has been modified from config - if(!authentication.equals("~MANUAL_ENTRY")){ + if(!authentication.equals("~MANUAL_ENTRY~")){ httpConf.authorizationHeader(authentication) } @@ -87,7 +89,7 @@ class PetApiSimulation extends Simulation { .feed(addPetBodyFeeder) .exec(http("addPet") .httpRequest("POST","/pet") - .body(StringBody(Pet.toStringBody("${id}","${category}","${name}","${tags}","${status}","${photoUrls}"))) + .body(StringBody(Pet.toStringBody("${status}","${id}","${tags}","${category}","${name}","${photoUrls}"))) ) // Run scnaddPet with warm up and reach a constant rate for entire duration @@ -162,7 +164,7 @@ class PetApiSimulation extends Simulation { .feed(updatePetBodyFeeder) .exec(http("updatePet") .httpRequest("PUT","/pet") - .body(StringBody(Pet.toStringBody("${id}","${category}","${name}","${tags}","${status}","${photoUrls}"))) + .body(StringBody(Pet.toStringBody("${status}","${id}","${tags}","${category}","${name}","${photoUrls}"))) ) // Run scnupdatePet with warm up and reach a constant rate for entire duration @@ -195,8 +197,8 @@ class PetApiSimulation extends Simulation { .feed(uploadFilePATHFeeder) .exec(http("uploadFile") .httpRequest("POST","/pet/${petId}/uploadImage") - .formParam("file","${file}") .formParam("additionalMetadata","${additionalMetadata}") + .formParam("file","${file}") ) // Run scnuploadFile with warm up and reach a constant rate for entire duration diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala index 3331dc06aa2..906278edbb1 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/StoreApiSimulation.scala @@ -15,10 +15,12 @@ class StoreApiSimulation extends Simulation { def getCurrentDirectory = new File("").getAbsolutePath def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + def userConfDirectory = getCurrentDirectory + "/src/gatling/resources/conf" // basic test setup val configName = System.getProperty("testConfig", "baseline") - val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val config = ConfigFactory.parseFile(new File(userConfDirectory + File.separator + configName + ".conf")) + .withFallback(ConfigFactory.parseFile(new File(userConfDirectory + File.separator + "default.conf"))) val durationSeconds = config.getInt("performance.durationSeconds") val rampUpSeconds = config.getInt("performance.rampUpSeconds") val rampDownSeconds = config.getInt("performance.rampDownSeconds") @@ -42,7 +44,7 @@ class StoreApiSimulation extends Simulation { // Setup http protocol configuration val httpConf = http - .baseURL("http://petstore.swagger.io/v2") + .baseUrl("http://petstore.swagger.io/v2") .doNotTrackHeader("1") .acceptLanguageHeader("en-US,en;q=0.5") .acceptEncodingHeader("gzip, deflate") @@ -51,7 +53,7 @@ class StoreApiSimulation extends Simulation { .contentTypeHeader(contentTypeHeader) // set authorization header if it has been modified from config - if(!authentication.equals("~MANUAL_ENTRY")){ + if(!authentication.equals("~MANUAL_ENTRY~")){ httpConf.authorizationHeader(authentication) } @@ -116,7 +118,7 @@ class StoreApiSimulation extends Simulation { .feed(placeOrderBodyFeeder) .exec(http("placeOrder") .httpRequest("POST","/store/order") - .body(StringBody(Order.toStringBody("${id}","${shipDate}","${complete}","${quantity}","${status}","${petId}"))) + .body(StringBody(Order.toStringBody("${status}","${id}","${petId}","${quantity}","${complete}","${shipDate}"))) ) // Run scnplaceOrder with warm up and reach a constant rate for entire duration diff --git a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala index b065e226dff..7012b9be50b 100644 --- a/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala +++ b/samples/client/petstore/scala-gatling/src/gatling/scala/io/swagger/client/api/UserApiSimulation.scala @@ -15,10 +15,12 @@ class UserApiSimulation extends Simulation { def getCurrentDirectory = new File("").getAbsolutePath def userDataDirectory = getCurrentDirectory + "/src/gatling/resources/data" + def userConfDirectory = getCurrentDirectory + "/src/gatling/resources/conf" // basic test setup val configName = System.getProperty("testConfig", "baseline") - val config = ConfigFactory.load(configName).withFallback(ConfigFactory.load("default")) + val config = ConfigFactory.parseFile(new File(userConfDirectory + File.separator + configName + ".conf")) + .withFallback(ConfigFactory.parseFile(new File(userConfDirectory + File.separator + "default.conf"))) val durationSeconds = config.getInt("performance.durationSeconds") val rampUpSeconds = config.getInt("performance.rampUpSeconds") val rampDownSeconds = config.getInt("performance.rampDownSeconds") @@ -42,7 +44,7 @@ class UserApiSimulation extends Simulation { // Setup http protocol configuration val httpConf = http - .baseURL("http://petstore.swagger.io/v2") + .baseUrl("http://petstore.swagger.io/v2") .doNotTrackHeader("1") .acceptLanguageHeader("en-US,en;q=0.5") .acceptEncodingHeader("gzip, deflate") @@ -51,7 +53,7 @@ class UserApiSimulation extends Simulation { .contentTypeHeader(contentTypeHeader) // set authorization header if it has been modified from config - if(!authentication.equals("~MANUAL_ENTRY")){ + if(!authentication.equals("~MANUAL_ENTRY~")){ httpConf.authorizationHeader(authentication) } @@ -82,7 +84,7 @@ class UserApiSimulation extends Simulation { .feed(createUserBodyFeeder) .exec(http("createUser") .httpRequest("POST","/user") - .body(StringBody(User.toStringBody("${password}","${id}","${lastName}","${firstName}","${email}","${userStatus}","${phone}","${username}"))) + .body(StringBody(User.toStringBody("${email}","${firstName}","${lastName}","${id}","${userStatus}","${phone}","${password}","${username}"))) ) // Run scncreateUser with warm up and reach a constant rate for entire duration @@ -183,7 +185,7 @@ class UserApiSimulation extends Simulation { .feed(updateUserPATHFeeder) .exec(http("updateUser") .httpRequest("PUT","/user/${username}") - .body(StringBody(User.toStringBody("${password}","${id}","${lastName}","${firstName}","${email}","${userStatus}","${phone}","${username}"))) + .body(StringBody(User.toStringBody("${email}","${firstName}","${lastName}","${id}","${userStatus}","${phone}","${password}","${username}"))) ) // Run scnupdateUser with warm up and reach a constant rate for entire duration