### Question:
EnvironmentResource { @POST @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_JSON) @Path("stop/{projectName}/{exploratoryName}") public Response stopNotebook(@Auth UserInfo userInfo, @NotEmpty String user, @PathParam("projectName") String projectName, @PathParam("exploratoryName") String exploratoryName) { log.info("Admin {} is stopping notebook {} of user {}", userInfo.getName(), exploratoryName, user); environmentService.stopExploratory(userInfo, user, projectName, exploratoryName); return Response.ok().build(); } @Inject  EnvironmentResource(EnvironmentService environmentService); @GET @Path("all") @Produces(MediaType.APPLICATION_JSON) Response getAllEnv(@Auth UserInfo userInfo); @POST @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_JSON) @Path("stop/{projectName}/{exploratoryName}") Response stopNotebook(@Auth UserInfo userInfo, @NotEmpty String user,
								 @PathParam("projectName") String projectName,
								 @PathParam("exploratoryName") String exploratoryName); @POST @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_JSON) @Path("stop/{projectName}/{exploratoryName}/{computationalName}") Response stopCluster(@Auth UserInfo userInfo, @NotEmpty String user,
								@PathParam("projectName") String projectName,
								@PathParam("exploratoryName") String exploratoryName,
								@PathParam("computationalName") String computationalName); @POST @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_JSON) @Path("terminate/{projectName}/{exploratoryName}") Response terminateNotebook(@Auth UserInfo userInfo, @NotEmpty String user,
									  @PathParam("projectName") String projectName,
									  @PathParam("exploratoryName") String exploratoryName); @POST @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_JSON) @Path("terminate/{projectName}/{exploratoryName}/{computationalName}") Response terminateCluster(@Auth UserInfo userInfo, @NotEmpty String user,
									 @PathParam("projectName") String projectName,
									 @PathParam("exploratoryName") String exploratoryName,
									 @PathParam("computationalName") String computationalName);  }### Answer:
@Test public void stopNotebook() { doNothing().when(environmentService).stopExploratory(any(UserInfo.class), anyString(), anyString(), anyString()); final Response response = resources.getJerseyTest() .target("/environment/stop/projectName/explName") .request() .header("Authorization", "Bearer " + TOKEN) .post(Entity.text(USER)); assertEquals(HttpStatus.SC_OK, response.getStatus()); assertNull(response.getHeaderString(HttpHeaders.CONTENT_TYPE)); verify(environmentService).stopExploratory(new UserInfo(USER, TOKEN), USER, "projectName", "explName"); verifyNoMoreInteractions(environmentService); }