Search in sources :

Example 11 with Namespace

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

the class NamespaceServiceTest method testDeleteNamespaceLowerCaseParameters.

@Test
public void testDeleteNamespaceLowerCaseParameters() {
    // Create and persist a namespace entity using upper case values.
    namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE.toUpperCase());
    // Validate that this namespace exists.
    NamespaceKey namespaceKey = new NamespaceKey(NAMESPACE.toUpperCase());
    assertNotNull(namespaceDao.getNamespaceByKey(namespaceKey));
    // Delete the namespace using lower case input parameters.
    Namespace deletedNamespace = namespaceService.deleteNamespace(new NamespaceKey(NAMESPACE.toLowerCase()));
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE.toUpperCase(), 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 12 with Namespace

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

the class NamespaceServiceTest method testCreateNamespaceUpperCaseParameters.

@Test
public void testCreateNamespaceUpperCaseParameters() {
    // Create a namespace using upper case input parameters.
    Namespace resultNamespace = namespaceService.createNamespace(namespaceServiceTestHelper.createNamespaceCreateRequest(NAMESPACE.toUpperCase()));
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE.toUpperCase(), resultNamespace);
}
Also used : Namespace(org.finra.herd.model.api.xml.Namespace) Test(org.junit.Test)

Example 13 with Namespace

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

Example 14 with Namespace

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

Example 15 with Namespace

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

the class NamespaceRestControllerTest method testCreateNamespace.

@Test
public void testCreateNamespace() throws Exception {
    NamespaceCreateRequest request = namespaceServiceTestHelper.createNamespaceCreateRequest(NAMESPACE);
    Namespace namespace = new Namespace(NAMESPACE);
    when(namespaceService.createNamespace(request)).thenReturn(namespace);
    // Create a namespace.
    Namespace resultNamespace = namespaceRestController.createNamespace(request);
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE, resultNamespace);
    // Verify the external calls.
    verify(namespaceService).createNamespace(request);
    verifyNoMoreInteractions(namespaceService);
    // Validate the returned object.
    assertEquals(namespace, resultNamespace);
}
Also used : NamespaceCreateRequest(org.finra.herd.model.api.xml.NamespaceCreateRequest) 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