@Test
public void testGetCurrentUser() throws Exception
{

    // Create a set of test namespace authorizations.
    Set<NamespaceAuthorization> namespaceAuthorizations = new LinkedHashSet<>();
    namespaceAuthorizations.add(new NamespaceAuthorization(NAMESPACE, SUPPORTED_NAMESPACE_PERMISSIONS));
    namespaceAuthorizations.add(new NamespaceAuthorization(NAMESPACE_2, SUPPORTED_NAMESPACE_PERMISSIONS));
    UserAuthorizations userAuthorizations = new UserAuthorizations();
    userAuthorizations.setNamespaceAuthorizations(new ArrayList(namespaceAuthorizations));
    when(currentUserService.getCurrentUser()).thenReturn(userAuthorizations);
    // Get the current user information.
    UserAuthorizations resultUserAuthorizations = currentUserRestController.getCurrentUser();
    // Verify the external calls.
    verify(currentUserService).getCurrentUser();
    verifyNoMoreInteractions(currentUserService);
    // Validate the returned object.
    assertEquals(userAuthorizations, resultUserAuthorizations);
}