I ve got a simple test method, that test POST request
@Test
public void saveItem() {
//GIVEN
List<Item> newItems= (List<Item>) itemTestBuilder
.list()
.saved()
.build();
//WHEN
ResponseEntity<Item> response = restTemplate.postForEntity(ItemResourceConstants.PATH, newItems, null);
//THEN
assertEquals(HttpStatus.CREATED.value(), response.getStatusCodeValue());
}
and it works, but basically to test it correctlly I should check for more conditions. Problem is that the response type is null and have no idea how to check more assertions with that. Anyone has any idea?
Aucun commentaire:
Enregistrer un commentaire