Search in sources :

Example 1 with NamespaceKeys

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);
}
Also used : NamespaceKey(org.finra.herd.model.api.xml.NamespaceKey) NamespaceKeys(org.finra.herd.model.api.xml.NamespaceKeys) Test(org.junit.Test)

Example 2 with NamespaceKeys

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));
    }
}
Also used : NamespaceKey(org.finra.herd.model.api.xml.NamespaceKey) NamespaceKeys(org.finra.herd.model.api.xml.NamespaceKeys) Test(org.junit.Test)

Example 3 with NamespaceKeys

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;
}
Also used : NamespaceKeys(org.finra.herd.model.api.xml.NamespaceKeys)

Aggregations

NamespaceKeys (org.finra.herd.model.api.xml.NamespaceKeys)3 NamespaceKey (org.finra.herd.model.api.xml.NamespaceKey)2 Test (org.junit.Test)2