use of com.blade.mvc.http.HttpResponse in project blade by biezhi.
the class HttpResponseTest method testHeaders.
@Test
public void testHeaders() {
Response mockResponse = mockHttpResponse(200);
when(mockResponse.headers()).thenReturn(new HashMap<>());
Response response = new HttpResponse(mockResponse);
assertEquals(0, response.headers().size());
response.header("a", "123");
assertEquals(1, response.headers().size());
}
use of com.blade.mvc.http.HttpResponse in project blade by biezhi.
the class HttpResponseTest method testBadRequest.
@Test
public void testBadRequest() {
Response mockResponse = mockHttpResponse(200);
Response response = new HttpResponse(mockResponse);
response.badRequest();
assertEquals(400, response.statusCode());
}
Aggregations