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