@Test public void testLogoutNowWithDjupintegration() { HttpServletRequest request = mock(HttpServletRequest.class); HttpSession session = mock(HttpSession.class); WebCertUser webCertUser = new WebCertUser(); webCertUser.setOrigin(GRANTED_ORIGIN); webCertUser.setRoles(ImmutableMap.of(GRANTED_ROLE, new Role())); when(request.getSession()).thenReturn(session); when(webCertUserService.getUser()).thenReturn(webCertUser); Response res = userIntegrationController.logoutUserNow(request); assertEquals(Status.OK.getStatusCode(), res.getStatus()); verify(webCertUserService).removeSessionNow(session); }
@GET @Path("/logout/now") @PrometheusTimeMethod public Response logoutUserNow(@Context HttpServletRequest request) { super.validateAuthorities(); HttpSession session = request.getSession(); getWebCertUserService().removeSessionNow(session); return Response.ok().build(); }
UserIntegrationController extends BaseIntegrationController { @GET @Path("/logout/now") @PrometheusTimeMethod public Response logoutUserNow(@Context HttpServletRequest request) { super.validateAuthorities(); HttpSession session = request.getSession(); getWebCertUserService().removeSessionNow(session); return Response.ok().build(); } }
UserIntegrationController extends BaseIntegrationController { @GET @Path("/logout/now") @PrometheusTimeMethod public Response logoutUserNow(@Context HttpServletRequest request) { super.validateAuthorities(); HttpSession session = request.getSession(); getWebCertUserService().removeSessionNow(session); return Response.ok().build(); }  }
UserIntegrationController extends BaseIntegrationController { @GET @Path("/logout/now") @PrometheusTimeMethod public Response logoutUserNow(@Context HttpServletRequest request) { super.validateAuthorities(); HttpSession session = request.getSession(); getWebCertUserService().removeSessionNow(session); return Response.ok().build(); }  @GET @Path("/logout/now") @PrometheusTimeMethod Response logoutUserNow(@Context HttpServletRequest request); }
UserIntegrationController extends BaseIntegrationController { @GET @Path("/logout/now") @PrometheusTimeMethod public Response logoutUserNow(@Context HttpServletRequest request) { super.validateAuthorities(); HttpSession session = request.getSession(); getWebCertUserService().removeSessionNow(session); return Response.ok().build(); }  @GET @Path("/logout/now") @PrometheusTimeMethod Response logoutUserNow(@Context HttpServletRequest request);  }