I have this test I'm writing in RestAssured. I want to extract the id in String but always returning it as array. This is the test I have written so far.
@Test(priority = 1)
public static void searchForUsername( ) throws Throwable {
ValidatableResponse response= given().contentType(ContentType.JSON).queryParam("username",
"Delphine").log().parameters().get("https://jsonplaceholder.typicode.com/users").then().log().all();
JsonPath extractor = response.extract().jsonPath();
userId = extractor.getString("id");
System.out.println(userId);
}
It prints it as [9] instead of 9