use of org.finra.herd.model.api.xml.NamespaceCreateRequest in project herd by FINRAOS.
the class NamespaceServiceTestHelper method createNamespaceCreateRequest.
/**
* Creates a namespace create request.
*
* @param namespaceCode the namespace code
*
* @return the newly created namespace create request
*/
public NamespaceCreateRequest createNamespaceCreateRequest(String namespaceCode) {
NamespaceCreateRequest request = new NamespaceCreateRequest();
request.setNamespaceCode(namespaceCode);
return request;
}
use of org.finra.herd.model.api.xml.NamespaceCreateRequest 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