use of com.tvd12.ezyhttp.client.request.RequestEntity in project ezyhttp by youngmonkeys.
the class RequestEntityTest method buildWithBodyNull.
@Test
public void buildWithBodyNull() {
// given
RequestEntity sut = RequestEntity.builder().body(null).build();
// when
// then
Asserts.assertNull(sut.getHeader("unknown"));
Asserts.assertEquals(ContentTypes.APPLICATION_JSON, sut.getContentType());
System.out.println(sut);
}
use of com.tvd12.ezyhttp.client.request.RequestEntity in project ezyhttp by youngmonkeys.
the class RequestEntityTest method createByHeadersAndBody.
@Test
public void createByHeadersAndBody() {
// given
Map<String, List<String>> headers = new HashMap<>();
String body = RandomUtil.randomShortAlphabetString();
// when
RequestEntity sut = new RequestEntity(headers, body);
// then
Asserts.assertEquals(new MultiValueMap(headers), sut.getHeaders());
Asserts.assertEquals(body, sut.getBody());
}
Aggregations