Search in sources :

Example 6 with Namespace

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

the class NamespaceServiceTest method testCreateNamespaceLowerCaseParameters.

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

Example 7 with Namespace

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

the class NamespaceServiceTest method testDeleteNamespaceUpperCaseParameters.

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

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

the class NamespaceServiceTest method testGetNamespaceUpperCaseParameters.

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

Example 9 with Namespace

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

the class NamespaceServiceTest method testCreateNamespace.

@Test
public void testCreateNamespace() throws Exception {
    // Create a namespace.
    Namespace resultNamespace = namespaceService.createNamespace(namespaceServiceTestHelper.createNamespaceCreateRequest(NAMESPACE));
    // Validate the returned object.
    namespaceServiceTestHelper.validateNamespace(NAMESPACE, resultNamespace);
}
Also used : Namespace(org.finra.herd.model.api.xml.Namespace) Test(org.junit.Test)

Example 10 with Namespace

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

the class NamespaceServiceTest method testDeleteNamespaceTrimParameters.

@Test
public void testDeleteNamespaceTrimParameters() {
    // 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 using input parameters with leading and trailing empty spaces.
    Namespace deletedNamespace = namespaceService.deleteNamespace(new NamespaceKey(addWhitespace(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)

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