This is my code I need to oauth header for this - I have tried many ways but nothing worked
package com.endpoints.exampletest
import com.endpoints.examples.PE.{ Request}
import com.github.phisgr.gatling.grpc.Predef.{grpc, }
import io.gatling.core.Predef.
import io.gatling.core.structure.ChainBuilder
import com.endpoints.exampletest.{PEScenario1CL, PEScenario2CL, PEScenario7CL}
import scala.concurrent.duration._
import io.grpc.ManagedChannelBuilder
import io.grpc.Metadata
class PESimulation extends Simulation {
// Read Gradle project properties for users, rampUp, and maxDuration
val totalUsers = Integer.getInteger(“users”, 1) // Default to 1 if users property not provided
val rampUpTime = Integer.getInteger(“rampUp”, 10) // Default to 10 seconds if rampUp property not provided
val maxDuration = Integer.getInteger(“maxDuration”, 15) // Default to 15 seconds if maxDuration property not provided
val PE7 = PEScenario7CL.scn
setUp(
PE7.inject(rampUsers(totalUsers) during (rampUpTime))
// PE2.inject(rampUsers(PE2Users) during (rampUpTime))
).protocols(
grpc(managedChannelBuilder(“ip address of server”, 80).usePlaintext() // Establish a new gRPC connection for each request
)
).maxDuration(maxDuration seconds)
}