@Test public void testLogoutCancel() { String sessionId = "sessionId"; HttpServletRequest request = mock(HttpServletRequest.class); HttpSession session = mock(HttpSession.class); when(request.getSession()).thenReturn(session); when(session.getId()).thenReturn(sessionId); userApiController.cancelLogout(request); verify(webCertUserService).cancelScheduledLogout(sessionId); }
@GET @Path("/logout/cancel") @PrometheusTimeMethod public Response cancelLogout(@Context HttpServletRequest request) { HttpSession session = request.getSession(); getWebCertUserService().cancelScheduledLogout(session.getId()); return Response.ok().build(); }
UserApiController extends AbstractApiController { @GET @Path("/logout/cancel") @PrometheusTimeMethod public Response cancelLogout(@Context HttpServletRequest request) { HttpSession session = request.getSession(); getWebCertUserService().cancelScheduledLogout(session.getId()); return Response.ok().build(); } }
UserApiController extends AbstractApiController { @GET @Path("/logout/cancel") @PrometheusTimeMethod public Response cancelLogout(@Context HttpServletRequest request) { HttpSession session = request.getSession(); getWebCertUserService().cancelScheduledLogout(session.getId()); return Response.ok().build(); }  }
UserApiController extends AbstractApiController { @GET @Path("/logout/cancel") @PrometheusTimeMethod public Response cancelLogout(@Context HttpServletRequest request) { HttpSession session = request.getSession(); getWebCertUserService().cancelScheduledLogout(session.getId()); return Response.ok().build(); }  @GET @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response getUser(); @PUT @Path("/features") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response userFeatures(WebUserFeaturesRequest webUserFeaturesRequest); @POST @Path("/andraenhet") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response changeSelectedUnitOnUser(ChangeSelectedUnitRequest request); @PUT @Path("/godkannavtal") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response godkannAvtal(); @DELETE @Path("/privatlakaravtal") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response taBortAvtalsGodkannande(); @GET @Path("/latestavtal") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response getAvtal(); @GET @Path("/ping") @PrometheusTimeMethod Response clientPing(); @PUT @Path("/preferences") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response storeUserMetdataEntry(WebUserPreferenceStorageRequest request); @DELETE @Path("/preferences/{key}") @PrometheusTimeMethod Response deleteUserPreferenceEntry(@PathParam("key") String prefKey); @GET @Path("/logout") @PrometheusTimeMethod Response logoutUserAfterTimeout(@Context HttpServletRequest request); @GET @Path("/logout/cancel") @PrometheusTimeMethod Response cancelLogout(@Context HttpServletRequest request); }
UserApiController extends AbstractApiController { @GET @Path("/logout/cancel") @PrometheusTimeMethod public Response cancelLogout(@Context HttpServletRequest request) { HttpSession session = request.getSession(); getWebCertUserService().cancelScheduledLogout(session.getId()); return Response.ok().build(); }  @GET @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response getUser(); @PUT @Path("/features") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response userFeatures(WebUserFeaturesRequest webUserFeaturesRequest); @POST @Path("/andraenhet") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response changeSelectedUnitOnUser(ChangeSelectedUnitRequest request); @PUT @Path("/godkannavtal") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response godkannAvtal(); @DELETE @Path("/privatlakaravtal") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response taBortAvtalsGodkannande(); @GET @Path("/latestavtal") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response getAvtal(); @GET @Path("/ping") @PrometheusTimeMethod Response clientPing(); @PUT @Path("/preferences") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response storeUserMetdataEntry(WebUserPreferenceStorageRequest request); @DELETE @Path("/preferences/{key}") @PrometheusTimeMethod Response deleteUserPreferenceEntry(@PathParam("key") String prefKey); @GET @Path("/logout") @PrometheusTimeMethod Response logoutUserAfterTimeout(@Context HttpServletRequest request); @GET @Path("/logout/cancel") @PrometheusTimeMethod Response cancelLogout(@Context HttpServletRequest request);  }