SessionsResource { @DELETE @Path("/{session-id}") public Response removeSession(@PathParam("session-id") String sessionId) { if (LOG.isDebugEnabled()) { LOG.debug("Client sent remove session request : Session Id (" + sessionId + ")"); } Response response = null; try { initializeContext(); JerseyResourceDelegateContextKey<String> sessionIdKey = JerseyResourceDelegateContextKey.valueOf(sessionIdKeyName, String.class); context.put(sessionIdKey, sessionId); response = JerseyResourceDelegateUtil.runJerseyResourceDelegate( new RemoveSessionDelegate(), application, context, LOG); } catch (Throwable e) { LOG.error(e.getMessage(), e); response = ResourcesUtil.createExceptionResponse(null, e.getMessage()); } return response; }  @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createNewSession(NewSessionRequest request); @DELETE @Path("/{session-id}") Response removeSession(@PathParam("session-id") String sessionId); @GET @Path("/{session-id}/variables") @Produces(MediaType.APPLICATION_JSON) Response getAllSessionVariables(@PathParam("session-id") String sessionId); @PUT @Path("/{session-id}/variables") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response updateSessionVariables(@PathParam("session-id") String sessionId, 
      Map<String, Object> variables);  }
@Test public void testRemoveSession() throws Exception { NewSessionRequest request = new NewSessionRequest(); request.setUserName("tajo-user"); NewSessionResponse response = restClient.target(sessionsURI) .request().post(Entity.entity(request, MediaType.APPLICATION_JSON), NewSessionResponse.class); assertNotNull(response); assertTrue(response.getId() != null && !response.getId().isEmpty()); Response restResponse = restClient.target(sessionsURI) .path("/{session-id}").resolveTemplate("session-id", response.getId()) .request().delete(); assertNotNull(restResponse); assertEquals(Status.OK.getStatusCode(), restResponse.getStatus()); }