А
Size: a a a
А
А
AB
AB
А
E
EB
R(
R(
d
ZE
d
MK
VS
VS
i
static RequestSpecification requestSpec;
public static RequestSpecification getRequestSpecification(String basePath) {
requestSpec = new RequestSpecBuilder()
.log(LogDetail.ALL)
.setBaseUri(PATH)
.setPort(8172)
.setBasePath(basePath)
.setContentType(ContentType.JSON)
.build();
return requestSpec;
}
public Response POST(String basePath, JSONObject jsonObj, int statusCode){
return given()
.spec(getRequestSpecification(basePath))
.body(jsonObj.toString()) // use jsonObj toString method
.when()
.post()
.then()
.assertThat()
.statusCode(statusCode)
.extract().response();
}
i
@ParameterizedTest
@ValueSource(strings = {"user","consultant"})
public void registerByV2(String role) {
String phone = Utils.getPhone();
JSONObject jsonObj = new JSONObject()
.put("lastName", "The LastName")
.put("name", "The Name")
.put("phone",phone)
.put("role", role);
POST(AUTH+REGISTER, jsonObj, 200);
}
ZE
AS