use of gov.ca.cwds.rest.api.domain.cms.SystemMeta in project API by ca-cwds.
the class SystemCodeServiceTest method findReturnsCorrectEntitySystemMetas.
@Test
public void findReturnsCorrectEntitySystemMetas() throws Exception {
String id = "";
SystemMeta validSysMeta = MAPPER.readValue(fixture("fixtures/domain/legacy/SystemMeta/valid/valid.json"), SystemMeta.class);
gov.ca.cwds.data.persistence.cms.SystemMeta systemMeta = new gov.ca.cwds.data.persistence.cms.SystemMeta("GVR_ENTC", "Government Entity Type", "Government Entity");
gov.ca.cwds.data.persistence.cms.SystemMeta[] foundSysMetas = new gov.ca.cwds.data.persistence.cms.SystemMeta[1];
foundSysMetas[0] = systemMeta;
ImmutableSet.Builder<SystemMeta> builder = ImmutableSet.builder();
builder.add(validSysMeta);
Set<SystemMeta> expectedSysMetas = builder.build();
SystemMetaListResponse expected = new SystemMetaListResponse(expectedSysMetas);
when(systemMetaDao.findAll()).thenReturn(foundSysMetas);
SystemMetaListResponse found = (SystemMetaListResponse) systemCodeService.find(id);
assertThat(found, is(expected));
}
Aggregations