test_class.declarator: USERNAME = "username"
test_class.modifier: private static final
test_class.original_string: private static final String USERNAME = "username";
test_class.type: String
test_class.var_name: USERNAME
test_class.declarator: PASSWORD = "password"
test_class.modifier: private static final
test_class.original_string: private static final String PASSWORD = "password";
test_class.type: String
test_class.var_name: PASSWORD
test_class.declarator: ROLE = "role"
test_class.modifier: private static final
test_class.original_string: private static final String ROLE = "role";
test_class.type: String
test_class.var_name: ROLE
test_class.declarator: mockUserService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserService mockUserService;
test_class.type: UserService
test_class.var_name: mockUserService
test_class.declarator: mockAuthenticationService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AuthenticationService mockAuthenticationService;
test_class.type: AuthenticationService
test_class.var_name: mockAuthenticationService
test_class.declarator: mockHttpServletRequest
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private HttpServletRequest mockHttpServletRequest;
test_class.type: HttpServletRequest
test_class.var_name: mockHttpServletRequest
test_class.declarator: mockHttpServletResponse
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private HttpServletResponse mockHttpServletResponse;
test_class.type: HttpServletResponse
test_class.var_name: mockHttpServletResponse
test_class.declarator: mockUserEntity
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserEntity mockUserEntity;
test_class.type: UserEntity
test_class.var_name: mockUserEntity
test_class.declarator: userController
test_class.modifier: private
test_class.original_string: private UserController userController;
test_class.type: UserController
test_class.var_name: userController
test_class.file: application/confagrid-webapp/src/test/java/com/aleggeup/confagrid/user/UserControllerTest.java
test_class.identifier: UserControllerTest
test_case.body: @Test
      public void testCheckAnonymousHeader() {
          Mockito.when(mockHttpServletResponse.getHeader(JwtFilter.HEADER_CLAIMS_SUBJECT))
              .thenReturn(JwtFilter.SUBJECT_ANONYMOUS);
  
          final LoginResponse loginResponse = userController.check(mockHttpServletResponse);
  
          assertNotNull(loginResponse);
  
          Mockito.verify(mockHttpServletResponse, Mockito.times(2)).getHeader(JwtFilter.HEADER_CLAIMS_SUBJECT);
          Mockito.verify(mockAuthenticationService).anonymousToken();
      }
test_case.class_method_signature: UserControllerTest.testCheckAnonymousHeader()
test_case.full_signature: @Test public void testCheckAnonymousHeader()
test_case.identifier: testCheckAnonymousHeader
test_case.invocations: thenReturn when getHeader check assertNotNull getHeader verify times anonymousToken verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCheckAnonymousHeader()
focal_class.declarator: userService
focal_class.modifier: private final
focal_class.original_string: private final UserService userService;
focal_class.type: UserService
focal_class.var_name: userService
focal_class.declarator: authenticationService
focal_class.modifier: private final
focal_class.original_string: private final AuthenticationService authenticationService;
focal_class.type: AuthenticationService
focal_class.var_name: authenticationService
focal_class.file: application/confagrid-webapp/src/main/java/com/aleggeup/confagrid/user/UserController.java
focal_class.identifier: UserController
focal_class.class_method_signature: UserController.UserController(final UserService userService, final AuthenticationService authenticationService)
focal_class.full_signature: @Autowired  UserController(final UserService userService, final AuthenticationService authenticationService)
focal_class.identifier: UserController
focal_class.modifiers: @Autowired
focal_class.parameters: (final UserService userService, final AuthenticationService authenticationService)
focal_class.signature:  UserController(final UserService userService, final AuthenticationService authenticationService)
focal_class.class_method_signature: UserController.login(@NonNull @RequestBody final LoginRequest login)
focal_class.full_signature: @RequestMapping(value = "login", method = RequestMethod.POST) public LoginResponse login(@NonNull @RequestBody final LoginRequest login)
focal_class.identifier: login
focal_class.modifiers: @RequestMapping(value = "login", method = RequestMethod.POST) public
focal_class.parameters: (@NonNull @RequestBody final LoginRequest login)
focal_class.return: LoginResponse
focal_class.signature: LoginResponse login(@NonNull @RequestBody final LoginRequest login)
focal_class.class_method_signature: UserController.check(final HttpServletResponse response)
focal_class.full_signature: @RequestMapping(value = "check", method = RequestMethod.GET) public LoginResponse check(final HttpServletResponse response)
focal_class.identifier: check
focal_class.modifiers: @RequestMapping(value = "check", method = RequestMethod.GET) public
focal_class.parameters: (final HttpServletResponse response)
focal_class.return: LoginResponse
focal_class.signature: LoginResponse check(final HttpServletResponse response)
focal_class.class_method_signature: UserController.claimContainsRole(@PathVariable final String role,
          final HttpServletRequest request)
focal_class.full_signature: @RequestMapping(value = "role/{role}", method = RequestMethod.GET) public Boolean claimContainsRole(@PathVariable final String role,
          final HttpServletRequest request)
focal_class.identifier: claimContainsRole
focal_class.modifiers: @RequestMapping(value = "role/{role}", method = RequestMethod.GET) public
focal_class.parameters: (@PathVariable final String role,
          final HttpServletRequest request)
focal_class.return: Boolean
focal_class.signature: Boolean claimContainsRole(@PathVariable final String role,
          final HttpServletRequest request)
focal_class.class_method_signature: UserController.getRoles(final Claims claims)
focal_class.full_signature: @SuppressWarnings("unchecked") private List<LinkedHashMap<String, String>> getRoles(final Claims claims)
focal_class.identifier: getRoles
focal_class.modifiers: @SuppressWarnings("unchecked") private
focal_class.parameters: (final Claims claims)
focal_class.return: List<LinkedHashMap<String, String>>
focal_class.signature: List<LinkedHashMap<String, String>> getRoles(final Claims claims)
focal_method.body: @RequestMapping(value = "check", method = RequestMethod.GET)
      public LoginResponse check(final HttpServletResponse response) {
          if (JwtFilter.SUBJECT_ANONYMOUS.equals(response.getHeader(JwtFilter.HEADER_CLAIMS_SUBJECT))) {
              return new LoginResponse(JwtFilter.ANONYMOUS_USER_ID, response.getHeader(JwtFilter.HEADER_CLAIMS_SUBJECT),
                  authenticationService.anonymousToken());
          }
  
          return new LoginResponse(response.getHeader(JwtFilter.HEADER_CLAIMS_USER_ID),
              response.getHeader(JwtFilter.HEADER_CLAIMS_SUBJECT),
              response.getHeader(JwtFilter.JWT_TOKEN));
      }
focal_method.class_method_signature: UserController.check(final HttpServletResponse response)
focal_method.full_signature: @RequestMapping(value = "check", method = RequestMethod.GET) public LoginResponse check(final HttpServletResponse response)
focal_method.identifier: check
focal_method.invocations: equals getHeader getHeader anonymousToken getHeader getHeader getHeader
focal_method.modifiers: @RequestMapping(value = "check", method = RequestMethod.GET) public
focal_method.parameters: (final HttpServletResponse response)
focal_method.return: LoginResponse
focal_method.signature: LoginResponse check(final HttpServletResponse response)