use of io.restassured.response.Response in project tutorials by eugenp.
the class MyUserLiveTest method givenPartialLastName_whenGettingListOfUsers_thenCorrect.
@Test
public void givenPartialLastName_whenGettingListOfUsers_thenCorrect() {
final Response response = givenAuth().get(URL_PREFIX + "?lastName=do");
final MyUser[] result = response.as(MyUser[].class);
assertEquals(result.length, 2);
}
use of io.restassured.response.Response in project tutorials by eugenp.
the class ApplicationLiveTest method givenUserWithReadPrivilegeAndHasPermission_whenGetFooById_thenOK.
@Test
public void givenUserWithReadPrivilegeAndHasPermission_whenGetFooById_thenOK() {
final Response response = givenAuth("john", "123").get("http://localhost:8082/spring-security-mvc-boot/foos/1");
assertEquals(200, response.getStatusCode());
assertTrue(response.asString().contains("id"));
}
use of io.restassured.response.Response in project tutorials by eugenp.
the class ApplicationLiveTest method givenUserMemberInOrganization_whenGetOrganization_thenOK.
//
@Test
public void givenUserMemberInOrganization_whenGetOrganization_thenOK() {
final Response response = givenAuth("john", "123").get("http://localhost:8082/spring-security-mvc-boot/organizations/1");
assertEquals(200, response.getStatusCode());
assertTrue(response.asString().contains("id"));
}
use of io.restassured.response.Response in project tutorials by eugenp.
the class ApplicationLiveTest method givenDisabledSecurityExpression_whenGetFooByName_thenError.
//
@Test
public void givenDisabledSecurityExpression_whenGetFooByName_thenError() {
final Response response = givenAuth("john", "123").get("http://localhost:8082/spring-security-mvc-boot/foos?name=sample");
assertEquals(500, response.getStatusCode());
assertTrue(response.asString().contains("method hasAuthority() not allowed"));
}
use of io.restassured.response.Response in project okapi by folio-org.
the class MainDeployTest method testClusterMode.
@Test
public void testClusterMode(TestContext context) {
async = context.async();
String[] args = { "cluster" };
MainDeploy d = new MainDeploy();
d.init(args, res -> {
vertx = res.succeeded() ? res.result() : null;
Assert.assertTrue("main1 " + res.cause(), res.succeeded());
RestAssuredClient c;
Response r;
c = api.createRestAssured3();
r = c.given().get("/_/proxy/modules").then().statusCode(200).log().ifValidationFails().extract().response();
Assert.assertTrue("raml: " + c.getLastReport().toString(), c.getLastReport().isEmpty());
async.complete();
});
}
Aggregations