### Question:
ExploratoryResource implements ExploratoryAPI { @PUT public Response create(@Auth UserInfo userInfo, @Valid @NotNull ExploratoryCreateFormDTO formDTO) { log.debug("Creating exploratory environment {} with name {} for user {}", formDTO.getImage(), formDTO.getName(), userInfo.getName()); if (!UserRoles.checkAccess(userInfo, RoleType.EXPLORATORY, formDTO.getImage(), userInfo.getRoles())) { log.warn("Unauthorized attempt to create a {} by user {}", formDTO.getImage(), userInfo.getName()); throw new DlabException("You do not have the privileges to create a " + formDTO.getTemplateName()); } String uuid = exploratoryService.create(userInfo, getExploratory(formDTO), formDTO.getProject()); return Response.ok(uuid).build(); } @Inject  ExploratoryResource(ExploratoryService exploratoryService); @GET Response getExploratoryPopUp(@Auth UserInfo userInfo); @PUT Response create(@Auth UserInfo userInfo,
						   @Valid @NotNull ExploratoryCreateFormDTO formDTO); @POST @RolesAllowed(UserSessionDurationAuthorizer.SHORT_USER_SESSION_DURATION) String start(@Auth UserInfo userInfo,
						@Valid @NotNull ExploratoryActionFormDTO formDTO); @DELETE @Path("/{project}/{name}/stop") String stop(@Auth UserInfo userInfo,
					   @PathParam("project") String project,
					   @PathParam("name") String name); @DELETE @Path("/{project}/{name}/terminate") String terminate(@Auth UserInfo userInfo,
							@PathParam("project") String project,
							@PathParam("name") String name); @PUT @Path("/{project}/{name}/reconfigure") Response reconfigureSpark(@Auth UserInfo userInfo,
									 @PathParam("project") String project,
									 @PathParam("name") String name,
									 List<ClusterConfig> config); @GET @Path("/{project}/{name}/cluster/config") Response getClusterConfig(@Auth UserInfo userInfo,
									 @PathParam("project") String project,
									 @PathParam("name") String name);  }### Answer:
@Test public void create() { when(exploratoryService.create(any(UserInfo.class), any(Exploratory.class), anyString())).thenReturn( "someUuid"); final Response response = resources.getJerseyTest() .target("/infrastructure_provision/exploratory_environment") .request() .header("Authorization", "Bearer " + TOKEN) .put(Entity.json(getExploratoryCreateFormDTO())); assertEquals(HttpStatus.SC_OK, response.getStatus()); assertEquals("someUuid", response.readEntity(String.class)); assertEquals(MediaType.APPLICATION_JSON, response.getHeaderString(HttpHeaders.CONTENT_TYPE)); verify(exploratoryService).create(refEq(getUserInfo()), refEq(getExploratory(getExploratoryCreateFormDTO())), eq("project")); verifyNoMoreInteractions(exploratoryService); }