@Test
public void testGetUserNamespaceAuthorization()
{

    // Create a user namespace authorization key
    UserNamespaceAuthorizationKey key = new UserNamespaceAuthorizationKey(USER_ID, NAMESPACE);
    UserNamespaceAuthorization userNamespaceAuthorization = new UserNamespaceAuthorization(ID, key, SUPPORTED_NAMESPACE_PERMISSIONS);
    when(userNamespaceAuthorizationService.getUserNamespaceAuthorization(key)).thenReturn(userNamespaceAuthorization);
    // Get a user namespace authorization.
    UserNamespaceAuthorization resultUserNamespaceAuthorization =
        userNamespaceAuthorizationRestController.getUserNamespaceAuthorization(key.getUserId(), key.getNamespace());
    // Verify the external calls.
    verify(userNamespaceAuthorizationService).getUserNamespaceAuthorization(key);
    verifyNoMoreInteractions(userNamespaceAuthorizationService);
    // Validate the returned object.
    assertEquals(userNamespaceAuthorization, resultUserNamespaceAuthorization);
}