Search in sources :

Example 1 with NamespaceCreateRequest

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;
}
Also used : NamespaceCreateRequest(org.finra.herd.model.api.xml.NamespaceCreateRequest)

Example 2 with NamespaceCreateRequest

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

Aggregations

NamespaceCreateRequest (org.finra.herd.model.api.xml.NamespaceCreateRequest)2 Namespace (org.finra.herd.model.api.xml.Namespace)1 Test (org.junit.Test)1