test_class.declarator: currentUserRestController
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private CurrentUserRestController currentUserRestController;
test_class.type: CurrentUserRestController
test_class.var_name: currentUserRestController
test_class.declarator: currentUserService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private CurrentUserService currentUserService;
test_class.type: CurrentUserService
test_class.var_name: currentUserService
test_class.file: herd-code/herd-rest/src/test/java/org/finra/herd/rest/CurrentUserRestControllerTest.java
test_class.identifier: CurrentUserRestControllerTest
test_class.superclass: extends AbstractRestTest
test_case.body: @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);
      }
test_case.class_method_signature: CurrentUserRestControllerTest.testGetCurrentUser()
test_case.full_signature: @Test public void testGetCurrentUser()
test_case.identifier: testGetCurrentUser
test_case.invocations: add add setNamespaceAuthorizations thenReturn when getCurrentUser getCurrentUser getCurrentUser verify verifyNoMoreInteractions assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetCurrentUser()
focal_class.declarator: CURRENT_USER_URI_PREFIX = "/currentUser"
focal_class.modifier: public static final
focal_class.original_string: public static final String CURRENT_USER_URI_PREFIX = "/currentUser";
focal_class.type: String
focal_class.var_name: CURRENT_USER_URI_PREFIX
focal_class.declarator: currentUserService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private CurrentUserService currentUserService;
focal_class.type: CurrentUserService
focal_class.var_name: currentUserService
focal_class.file: herd-code/herd-rest/src/main/java/org/finra/herd/rest/CurrentUserRestController.java
focal_class.identifier: CurrentUserRestController
focal_class.class_method_signature: CurrentUserRestController.getCurrentUser()
focal_class.full_signature: @RequestMapping(value = CURRENT_USER_URI_PREFIX, method = RequestMethod.GET) @PreAuthorize("isAuthenticated()") @Secured(SecurityFunctions.FN_CURRENT_USER_GET) public UserAuthorizations getCurrentUser()
focal_class.identifier: getCurrentUser
focal_class.modifiers: @RequestMapping(value = CURRENT_USER_URI_PREFIX, method = RequestMethod.GET) @PreAuthorize("isAuthenticated()") @Secured(SecurityFunctions.FN_CURRENT_USER_GET) public
focal_class.parameters: ()
focal_class.return: UserAuthorizations
focal_class.signature: UserAuthorizations getCurrentUser()
focal_method.body: @RequestMapping(value = CURRENT_USER_URI_PREFIX, method = RequestMethod.GET)
      @PreAuthorize("isAuthenticated()")
      @Secured(SecurityFunctions.FN_CURRENT_USER_GET)
      public UserAuthorizations getCurrentUser()
      {
          return currentUserService.getCurrentUser();
      }
focal_method.class_method_signature: CurrentUserRestController.getCurrentUser()
focal_method.full_signature: @RequestMapping(value = CURRENT_USER_URI_PREFIX, method = RequestMethod.GET) @PreAuthorize("isAuthenticated()") @Secured(SecurityFunctions.FN_CURRENT_USER_GET) public UserAuthorizations getCurrentUser()
focal_method.identifier: getCurrentUser
focal_method.invocations: getCurrentUser
focal_method.modifiers: @RequestMapping(value = CURRENT_USER_URI_PREFIX, method = RequestMethod.GET) @PreAuthorize("isAuthenticated()") @Secured(SecurityFunctions.FN_CURRENT_USER_GET) public
focal_method.parameters: ()
focal_method.return: UserAuthorizations
focal_method.signature: UserAuthorizations getCurrentUser()