Search in sources :

Example 1 with Namespace

use of org.finra.herd.model.api.xml.Namespace in project herd by FINRAOS.

the class NamespaceRestControllerTest method testDeleteNamespace.

@Test
public void testDeleteNamespace() throws Exception {
    Namespace namespace = new Namespace(NAMESPACE);
    when(namespaceService.deleteNamespace(new NamespaceKey(NAMESPACE))).thenReturn(namespace);
    // Delete this namespace.
    Namespace deletedNamespace = namespaceRestController.deleteNamespace(NAMESPACE);
    // Verify the external calls.
    verify(namespaceService).deleteNamespace(new NamespaceKey(NAMESPACE));
    verifyNoMoreInteractions(namespaceService);
    // Validate the returned object.
    assertEquals(namespace, deletedNamespace);
}
Also used : NamespaceKey(org.finra.herd.model.api.xml.NamespaceKey) Namespace(org.finra.herd.model.api.xml.Namespace) Test(org.junit.Test)

Example 2 with Namespace

use of org.finra.herd.model.api.xml.Namespace in project herd by FINRAOS.

the class NamespaceServiceTest method testCreateNamespaceTrimParameters.

@Test
public void testCreateNamespaceTrimParameters() {
    // Create a namespace using input parameters with leading and trailing empty spaces.
    Namespace resultNamespace = namespaceService.createNamespace(namespaceServiceTestHelper.createNamespaceCreateRequest(addWhitespace(NAMESPACE)));
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE, resultNamespace);
}
Also used : Namespace(org.finra.herd.model.api.xml.Namespace) Test(org.junit.Test)

Example 3 with Namespace

use of org.finra.herd.model.api.xml.Namespace in project herd by FINRAOS.

the class NamespaceServiceTest method testGetNamespaceLowerCaseParameters.

@Test
public void testGetNamespaceLowerCaseParameters() {
    // Create and persist a namespace entity using upper case values.
    namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE.toUpperCase());
    // Retrieve the namespace using lower case input parameters.
    Namespace resultNamespace = namespaceService.getNamespace(new NamespaceKey(NAMESPACE.toLowerCase()));
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE.toUpperCase(), resultNamespace);
}
Also used : NamespaceKey(org.finra.herd.model.api.xml.NamespaceKey) Namespace(org.finra.herd.model.api.xml.Namespace) Test(org.junit.Test)

Example 4 with Namespace

use of org.finra.herd.model.api.xml.Namespace in project herd by FINRAOS.

the class NamespaceServiceTest method testDeleteNamespace.

@Test
public void testDeleteNamespace() throws Exception {
    // Create and persist a namespace entity.
    namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
    // Validate that this namespace exists.
    NamespaceKey namespaceKey = new NamespaceKey(NAMESPACE);
    assertNotNull(namespaceDao.getNamespaceByKey(namespaceKey));
    // Delete this namespace.
    Namespace deletedNamespace = namespaceService.deleteNamespace(new NamespaceKey(NAMESPACE));
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE, deletedNamespace);
    // Ensure that this namespace is no longer there.
    assertNull(namespaceDao.getNamespaceByKey(namespaceKey));
}
Also used : NamespaceKey(org.finra.herd.model.api.xml.NamespaceKey) Namespace(org.finra.herd.model.api.xml.Namespace) Test(org.junit.Test)

Example 5 with Namespace

use of org.finra.herd.model.api.xml.Namespace in project herd by FINRAOS.

the class NamespaceServiceTest method testGetNamespace.

@Test
public void testGetNamespace() throws Exception {
    // Create and persist a namespace entity.
    namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE);
    // Retrieve the namespace.
    Namespace resultNamespace = namespaceService.getNamespace(new NamespaceKey(NAMESPACE));
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE, resultNamespace);
}
Also used : NamespaceKey(org.finra.herd.model.api.xml.NamespaceKey) Namespace(org.finra.herd.model.api.xml.Namespace) Test(org.junit.Test)

Aggregations

Namespace (org.finra.herd.model.api.xml.Namespace)16 Test (org.junit.Test)15 NamespaceKey (org.finra.herd.model.api.xml.NamespaceKey)10 NamespaceCreateRequest (org.finra.herd.model.api.xml.NamespaceCreateRequest)1