use of org.motechproject.mds.dto.DraftData in project motech by motech.
the class EntityControllerTest method shouldNotSaveTemporaryChangeIfEntityIsReadonly.
@Test
public void shouldNotSaveTemporaryChangeIfEntityIsReadonly() throws Exception {
doThrow(new EntityReadOnlyException("EntityName")).when(entityService).saveDraftEntityChanges(eq(9001L), any(DraftData.class));
controller.perform(post("/entities/9001/draft").body(new ObjectMapper().writeValueAsString(new DraftData()).getBytes()).contentType(MediaType.APPLICATION_JSON)).andExpect(status().isConflict()).andExpect(content().string(ENTITY_READ_ONLY));
}
Aggregations