Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ciandt-crodrigues committed Nov 8, 2023
1 parent 912ddd3 commit 8ee33b7
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
package mock

import com.intuit.karate.Runner
import com.intuit.karate.gatling.KarateProtocol
import com.intuit.karate.gatling.PreDef._
import io.gatling.core.Predef._
import io.gatling.core.structure.ScenarioBuilder

import scala.concurrent.duration._

class CatsSimulationWithSilentWarmUp extends Simulation {

MockUtils.startServer(0)

val protocol = karateProtocol(
val protocol: KarateProtocol = karateProtocol(
"/cats/{id}" -> Nil,
"/cats" -> pauseFor("get" -> 15, "post" -> 25)
)

protocol.nameResolver = (req, ctx) => req.getHeader("karate-name")
protocol.runner.karateEnv("perf")

val createWarmup = scenario("create warm-up").exec(karateFeature("classpath:mock/cats-create.feature").silent)
val create = scenario("create").exec(karateFeature("classpath:mock/cats-create.feature")).exec(session => {
val createWarmup: ScenarioBuilder = scenario("create warm-up").exec(karateFeature("classpath:mock/cats-create.feature").silent())
val create: ScenarioBuilder = scenario("create").exec(karateFeature("classpath:mock/cats-create.feature")).exec(session => {
println("*** id in gatling: " + session("id").as[String])
println("*** session status in gatling: " + session.status)
session
})

val deleteWarmup = scenario("delete warm-up").exec(karateFeature("classpath:mock/cats-delete.feature").silent)
val delete = scenario("delete").group("delete cats") {
val deleteWarmup: ScenarioBuilder = scenario("delete warm-up").exec(karateFeature("classpath:mock/cats-delete.feature").silent())
val delete: ScenarioBuilder = scenario("delete").group("delete cats") {
exec(karateFeature("classpath:mock/cats-delete.feature@name=delete"))
}

val customWarmup = scenario("custom warm-up").exec(karateFeature("classpath:mock/cats-rpc.feature").silent)
val custom = scenario("custom").exec(karateFeature("classpath:mock/custom-rpc.feature"))
val customWarmup: ScenarioBuilder = scenario("custom warm-up").exec(karateFeature("classpath:mock/cats-rpc.feature").silent())
val custom: ScenarioBuilder = scenario("custom").exec(karateFeature("classpath:mock/custom-rpc.feature"))

setUp(
createWarmup.inject(rampUsers(1) during (5 seconds)).andThen(
Expand Down

0 comments on commit 8ee33b7

Please sign in to comment.