RSEndpoint implements IRSEndpoint { void setContext(HttpSession httpSession) { ThreadLocalContextHolder.put(Constants.HTTPREQUEST, request); ThreadLocalContextHolder.put(Constants.HTTPSESSION, httpSession); }  @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Override String getMessageToClient(@FormParam(Constants.Message.MFC) String json); @Override HttpSession getHttpSession();  }
@Test public void testSetContext() { System.out.println("setContext"); HttpSession session = mock(HttpSession.class); instance.setContext(session); instance.setContext(session); assertThat(ThreadLocalContextHolder.get(Constants.HTTPSESSION)).isEqualTo(session); assertThat(ThreadLocalContextHolder.get(Constants.HTTPREQUEST)).isEqualTo(request); }