AuthenticationController { @RequestMapping(value = "/login", method = RequestMethod.GET) @ResponseStatus( HttpStatus.METHOD_NOT_ALLOWED ) public void get() { }  @RequestMapping(value = "/login", method = RequestMethod.POST) @ResponseStatus( HttpStatus.CREATED ) @ResponseBody Map<String, Object> login(@RequestBody AuthenticationRequest authenticationRequest); @RequestMapping(value = "/logout/{user}", method = RequestMethod.GET) @ResponseStatus( HttpStatus.OK ) @ResponseBody void logout(@PathVariable("user") final String userId); @RequestMapping(value = "/login", method = RequestMethod.GET) @ResponseStatus( HttpStatus.METHOD_NOT_ALLOWED ) void get();  }
@Test public void doLoginGet() throws Exception { mockMvc.perform(get("/login")).andExpect(status().isMethodNotAllowed()); }
@Test public void doLogoutGet() throws Exception { mockMvc.perform(get("/logout/"+ServiceTestConfiguration.USER_ID)) .andExpect(status().isOk()) .andDo(print()); }
@Test public void doLogoutGetNoUser() throws Exception { mockMvc.perform(get("/logout")) .andExpect(status().isNotFound()) .andDo(print()); }