test_class.declarator: mockMvc
test_class.modifier: @Autowired
    private
test_class.original_string: @Autowired
    private MockMvc mockMvc;
test_class.type: MockMvc
test_class.var_name: mockMvc
test_class.declarator: authenticationService
test_class.modifier: @MockBean
    private
test_class.original_string: @MockBean
    private AuthenticationService authenticationService;
test_class.type: AuthenticationService
test_class.var_name: authenticationService
test_class.declarator: headerGenerator
test_class.modifier: @MockBean
    private
test_class.original_string: @MockBean
    private AuthorizationHeaderGenerator headerGenerator;
test_class.type: AuthorizationHeaderGenerator
test_class.var_name: headerGenerator
test_class.declarator: password = uniquify("password")
test_class.modifier: private final
test_class.original_string: private final String password = uniquify("password");
test_class.type: String
test_class.var_name: password
test_class.declarator: username = uniquify("username")
test_class.modifier: private final
test_class.original_string: private final String username = uniquify("username");
test_class.type: String
test_class.var_name: username
test_class.declarator: token = uniquify("token")
test_class.modifier: private final
test_class.original_string: private final String token = uniquify("token");
test_class.type: String
test_class.var_name: token
test_class.declarator: objectMapper = new ObjectMapper()
test_class.modifier: private final
test_class.original_string: private final ObjectMapper objectMapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: objectMapper
test_class.file: doorman/src/test/java/io/servicecomb/company/auth/endpoint/rest/AuthenticationControllerTest.java
test_class.identifier: AuthenticationControllerTest
test_case.body: @Test
    public void validatesTokenAgainstStoredUserSessions() throws Exception {
      when(authenticationService.validate(token)).thenReturn(username);
  
      mockMvc.perform(
          post("/rest/validate")
              .contentType(APPLICATION_JSON_UTF8_VALUE)
              .content(objectMapper.writeValueAsBytes(new Token(token))))
          .andExpect(status().isOk())
          .andExpect(content().string(username));
    }
test_case.class_method_signature: AuthenticationControllerTest.validatesTokenAgainstStoredUserSessions()
test_case.full_signature: @Test public void validatesTokenAgainstStoredUserSessions()
test_case.identifier: validatesTokenAgainstStoredUserSessions
test_case.invocations: thenReturn when validate andExpect andExpect perform content contentType post writeValueAsBytes isOk status string content
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void validatesTokenAgainstStoredUserSessions()
focal_class.declarator: logger = LoggerFactory.getLogger(AuthenticationController.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(AuthenticationController.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: USERNAME = "username"
focal_class.modifier: static final
focal_class.original_string: static final String USERNAME = "username";
focal_class.type: String
focal_class.var_name: USERNAME
focal_class.declarator: PASSWORD = "password"
focal_class.modifier: static final
focal_class.original_string: static final String PASSWORD = "password";
focal_class.type: String
focal_class.var_name: PASSWORD
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.declarator: authorizationHeaderGenerator
focal_class.modifier: private final
focal_class.original_string: private final AuthorizationHeaderGenerator authorizationHeaderGenerator;
focal_class.type: AuthorizationHeaderGenerator
focal_class.var_name: authorizationHeaderGenerator
focal_class.file: doorman/src/main/java/io/servicecomb/company/auth/endpoint/rest/AuthenticationController.java
focal_class.identifier: AuthenticationController
focal_class.class_method_signature: AuthenticationController.AuthenticationController(
        AuthenticationService authenticationService,
        AuthorizationHeaderGenerator authorizationHeaderGenerator)
focal_class.full_signature: @Autowired  AuthenticationController(
        AuthenticationService authenticationService,
        AuthorizationHeaderGenerator authorizationHeaderGenerator)
focal_class.identifier: AuthenticationController
focal_class.modifiers: @Autowired
focal_class.parameters: (
        AuthenticationService authenticationService,
        AuthorizationHeaderGenerator authorizationHeaderGenerator)
focal_class.signature:  AuthenticationController(
        AuthenticationService authenticationService,
        AuthorizationHeaderGenerator authorizationHeaderGenerator)
focal_class.class_method_signature: AuthenticationController.login(
        @RequestParam(USERNAME) String username,
        @RequestParam(PASSWORD) String password)
focal_class.full_signature: @RequestMapping(value = "/login", method = POST, produces = TEXT_PLAIN_VALUE) public ResponseEntity<String> login(
        @RequestParam(USERNAME) String username,
        @RequestParam(PASSWORD) String password)
focal_class.identifier: login
focal_class.modifiers: @RequestMapping(value = "/login", method = POST, produces = TEXT_PLAIN_VALUE) public
focal_class.parameters: (
        @RequestParam(USERNAME) String username,
        @RequestParam(PASSWORD) String password)
focal_class.return: ResponseEntity<String>
focal_class.signature: ResponseEntity<String> login(
        @RequestParam(USERNAME) String username,
        @RequestParam(PASSWORD) String password)
focal_class.class_method_signature: AuthenticationController.validate(@RequestBody Token token)
focal_class.full_signature: @RequestMapping(value = "/validate", method = POST, consumes = APPLICATION_JSON_UTF8_VALUE, produces = TEXT_PLAIN_VALUE) @ResponseBody public String validate(@RequestBody Token token)
focal_class.identifier: validate
focal_class.modifiers: @RequestMapping(value = "/validate", method = POST, consumes = APPLICATION_JSON_UTF8_VALUE, produces = TEXT_PLAIN_VALUE) @ResponseBody public
focal_class.parameters: (@RequestBody Token token)
focal_class.return: String
focal_class.signature: String validate(@RequestBody Token token)
focal_method.body: @RequestMapping(value = "/validate", method = POST, consumes = APPLICATION_JSON_UTF8_VALUE, produces = TEXT_PLAIN_VALUE)
    @ResponseBody
    public String validate(@RequestBody Token token) {
      logger.info("Received validation request of token {}", token);
      return authenticationService.validate(token.getToken());
    }
focal_method.class_method_signature: AuthenticationController.validate(@RequestBody Token token)
focal_method.full_signature: @RequestMapping(value = "/validate", method = POST, consumes = APPLICATION_JSON_UTF8_VALUE, produces = TEXT_PLAIN_VALUE) @ResponseBody public String validate(@RequestBody Token token)
focal_method.identifier: validate
focal_method.invocations: info validate getToken
focal_method.modifiers: @RequestMapping(value = "/validate", method = POST, consumes = APPLICATION_JSON_UTF8_VALUE, produces = TEXT_PLAIN_VALUE) @ResponseBody public
focal_method.parameters: (@RequestBody Token token)
focal_method.return: String
focal_method.signature: String validate(@RequestBody Token token)