use of org.finra.herd.model.api.xml.NamespaceKey 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.NamespaceKey in project herd by FINRAOS.
the class NamespaceServiceTest method testGetNamespaceTrimParameters.
@Test
public void testGetNamespaceTrimParameters() {
// Create and persist a namespace entity.
namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
// Retrieve the namespace using input parameters with leading and trailing empty spaces.
Namespace resultNamespace = namespaceService.getNamespace(new NamespaceKey(addWhitespace(NAMESPACE)));
// Validate the returned object.
namespaceServiceTestHelper.validateNamespace(NAMESPACE, resultNamespace);
}
use of org.finra.herd.model.api.xml.NamespaceKey in project herd by FINRAOS.
the class NamespaceRestControllerTest method testGetNamespace.
@Test
public void testGetNamespace() throws Exception {
Namespace namespace = new Namespace(NAMESPACE);
when(namespaceService.getNamespace(new NamespaceKey(NAMESPACE))).thenReturn(namespace);
// Retrieve the namespace.
Namespace resultNamespace = namespaceRestController.getNamespace(NAMESPACE);
// Verify the external calls.
verify(namespaceService).getNamespace(new NamespaceKey(NAMESPACE));
verifyNoMoreInteractions(namespaceService);
// Validate the returned object.
assertEquals(namespace, resultNamespace);
}
Aggregations