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));
}
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);
}
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);
}
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);
}
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);
}
Aggregations