@Test
public void testDeleteUserNamespaceAuthorization()
{

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