development-and-dinosaurs/gatling-lambda-extension

Can't make the example work in kotlin

Closed this issue · 1 comments

I am using this in kotlin with gatling. I have the following code to invoke the lambda


import io.gatling.core.Predef.atOnceUsers
import io.gatling.core.Predef.scenario
import io.gatling.javaapi.core.Simulation
import io.toolebox.gatlinglambdaextension.Predef.lambda
import software.amazon.awssdk.services.lambda.LambdaClient


class ExampleSimulation : Simulation() {

   init { 
       setUp(
           scenario("My Lambda")
               .exec(
                   lambda("my-lambda-function-name")
                       .payload("{\"myKey\": \"myValue\"}")
               )
               .inject(
                   atOnceUsers(1)
               )
       ).protocols(
           lambda.client(LambdaClient.create())
       )
   }
}

I am getting some compilation errors with this example:

None of the following functions can be called with the arguments supplied.
lambda(GatlingConfiguration!) defined in io.toolebox.gatlinglambdaextension.Predef
lambda(Function1<Session!, Validation<String!>!>!) defined in io.toolebox.gatlinglambdaextension.Predef

It seems lambda() expects one the following arguments and the example gives it a name. Does the api has changed ?

This extension does not currently support the Java API released in Gatling 3.7.0, and is tied specific functionality that only works in Scala currently.

I'll be looking at adding a Java-compatible API at some point, as I want to use it now and I can't.

I've opened #25 that will allow this to happen, which is open for PRs, otherwise I will probably get around to it at some point now that I need it too.