use of org.springframework.mock.http.client.MockClientHttpResponse in project spring-framework by spring-projects.
the class ResponseCreatorsTests method withStatus.
@Test
public void withStatus() throws Exception {
DefaultResponseCreator responseCreator = MockRestResponseCreators.withStatus(HttpStatus.FORBIDDEN);
MockClientHttpResponse response = (MockClientHttpResponse) responseCreator.createResponse(null);
assertEquals(HttpStatus.FORBIDDEN, response.getStatusCode());
assertTrue(response.getHeaders().isEmpty());
assertNull(response.getBody());
}
use of org.springframework.mock.http.client.MockClientHttpResponse in project spring-framework by spring-projects.
the class ResponseCreatorsTests method badRequest.
@Test
public void badRequest() throws Exception {
DefaultResponseCreator responseCreator = MockRestResponseCreators.withBadRequest();
MockClientHttpResponse response = (MockClientHttpResponse) responseCreator.createResponse(null);
assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode());
assertTrue(response.getHeaders().isEmpty());
assertNull(response.getBody());
}
Aggregations