@Test
public void testGetUserNamespaceAuthorizationsByNamespace() throws Exception
{

    UserNamespaceAuthorizations userNamespaceAuthorizations = new UserNamespaceAuthorizations();
    when(userNamespaceAuthorizationService.getUserNamespaceAuthorizationsByNamespace(USER_ID)).thenReturn(userNamespaceAuthorizations);
    // Get user namespace authorizations for the specified user id.
    UserNamespaceAuthorizations resultUserNamespaceAuthorizations =
        userNamespaceAuthorizationRestController.getUserNamespaceAuthorizationsByNamespace(USER_ID);
    // Verify the external calls.
    verify(userNamespaceAuthorizationService).getUserNamespaceAuthorizationsByNamespace(USER_ID);
    verifyNoMoreInteractions(userNamespaceAuthorizationService);
    // Validate the returned object.
    assertEquals(resultUserNamespaceAuthorizations, userNamespaceAuthorizations);
}