Can someone help me understand how to pass a a var
val conn_str = "jdbc:postgresql://SomeDatabase/xyz?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory&user=password&user=password"
val conn = DriverManager.getConnection(conn_str)
val statement = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE)
val scn = scenario("TGT_AddTrip")
.exec(sessionFunction = (s: Session) => {
val getUsername = jdbcFeeder("jdbc:postgresql://somedatabase/xyz?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory",
"user", "password",
"select Distinct username from users u JOIN contacts c using(contact_id) where c.first_name like 'DriverFirstNameTest_%'")
var it = getUsername.records.iterator
var element = it.next()
var Username = element.get("username").get
println("Username = " + Username)
s
})
//Now I want to use the value for "Username" from above in the next section. But when I do it errors
.exec(http("GetTGT")
.post("http://auth.service-prodcopy.motusdev.com/auth/v1/tickets")
.body(StringBody("""username=+ Username + &password=1"""))
)