use of org.finra.herd.model.api.xml.NamespaceKeys in project herd by FINRAOS.
the class NamespaceRestControllerTest method testGetNamespaces.
@Test
public void testGetNamespaces() throws Exception {
NamespaceKeys namespaceKeys = new NamespaceKeys(Arrays.asList(new NamespaceKey(NAMESPACE), new NamespaceKey(NAMESPACE_2)));
when(namespaceService.getNamespaces()).thenReturn(namespaceKeys);
// Retrieve a list of namespace keys.
NamespaceKeys resultNamespaceKeys = namespaceRestController.getNamespaces();
// Verify the external calls.
verify(namespaceService).getNamespaces();
verifyNoMoreInteractions(namespaceService);
// Validate the returned object.
assertEquals(namespaceKeys, resultNamespaceKeys);
}
use of org.finra.herd.model.api.xml.NamespaceKeys in project herd by FINRAOS.
the class NamespaceServiceTest method testGetNamespaces.
@Test
public void testGetNamespaces() throws Exception {
// Create and persist namespace entities.
for (NamespaceKey key : namespaceDaoTestHelper.getTestNamespaceKeys()) {
namespaceDaoTestHelper.createNamespaceEntity(key.getNamespaceCode());
}
// Retrieve a list of namespace keys.
NamespaceKeys resultNamespaceKeys = namespaceService.getNamespaces();
// Validate the returned object.
assertNotNull(resultNamespaceKeys);
assertNotNull(resultNamespaceKeys.getNamespaceKeys());
assertTrue(resultNamespaceKeys.getNamespaceKeys().size() >= namespaceDaoTestHelper.getTestNamespaceKeys().size());
for (NamespaceKey key : namespaceDaoTestHelper.getTestNamespaceKeys()) {
assertTrue(resultNamespaceKeys.getNamespaceKeys().contains(key));
}
}
use of org.finra.herd.model.api.xml.NamespaceKeys in project herd by FINRAOS.
the class NamespaceServiceImpl method getNamespaces.
@Override
public NamespaceKeys getNamespaces() {
NamespaceKeys namespaceKeys = new NamespaceKeys();
namespaceKeys.getNamespaceKeys().addAll(namespaceDao.getNamespaces());
return namespaceKeys;
}
Aggregations