use of gov.ca.cwds.rest.api.domain.cms.PostedStaffPerson in project API by ca-cwds.
the class StaffPersonServiceTest method createReturnsCorrectPostedPerson.
@SuppressWarnings("javadoc")
@Test
public void createReturnsCorrectPostedPerson() throws Exception {
String id = "ABC";
StaffPerson staffPersonDomain = MAPPER.readValue(fixture("fixtures/domain/legacy/StaffPerson/valid/valid.json"), StaffPerson.class);
gov.ca.cwds.data.persistence.cms.StaffPerson toCreate = new gov.ca.cwds.data.persistence.cms.StaffPerson(id, staffPersonDomain, "2017-01-07");
StaffPerson request = new StaffPerson(toCreate);
when(staffPersonDao.create(any(gov.ca.cwds.data.persistence.cms.StaffPerson.class))).thenReturn(toCreate);
PostedStaffPerson expected = new PostedStaffPerson(toCreate);
PostedStaffPerson returned = staffPersonService.create(request);
assertThat(returned, is(expected));
}
Aggregations