### Question:
LibExploratoryResource { @GET @Path("/lib_list/formatted") public List<LibInfoRecord> getLibListFormatted(@Auth UserInfo userInfo, @QueryParam("project_name") @NotBlank String projectName, @QueryParam("exploratory_name") @NotBlank String exploratoryName) { log.debug("Loading formatted list of libraries for user {} and exploratory {}", userInfo.getName(), exploratoryName); try { return libraryService.getLibInfo(userInfo.getName(), projectName, exploratoryName); } catch (Exception t) { log.error("Cannot load list of libraries for user {} and exploratory {}", userInfo.getName(), exploratoryName, t); throw new DlabException("Cannot load formatted list of installed libraries: " + t.getLocalizedMessage(), t); } } @Inject  LibExploratoryResource(ExploratoryDAO exploratoryDAO, LibraryService libraryService,
								  ExternalLibraryService externalLibraryService); @GET @Path("/lib_groups") Iterable<String> getLibGroupList(@Auth UserInfo userInfo,
											@QueryParam("project_name") @NotBlank String projectName,
											@QueryParam("exploratory_name") @NotBlank String exploratoryName,
											@QueryParam("computational_name") String computationalName); @GET @Path("/lib_list") List<Document> getLibList(@Auth UserInfo userInfo,
									 @QueryParam("project_name") @NotBlank String projectName,
									 @QueryParam("exploratory_name") @NotBlank String exploratoryName,
									 @QueryParam("computational_name") String computationalName); @GET @Path("/lib_list/formatted") List<LibInfoRecord> getLibListFormatted(@Auth UserInfo userInfo,
												   @QueryParam("project_name") @NotBlank String projectName,
												   @QueryParam("exploratory_name") @NotBlank String exploratoryName); @POST @Path("/lib_install") Response libInstall(@Auth UserInfo userInfo,
							   @Valid @NotNull LibInstallFormDTO formDTO); @POST @Path("search/lib_list") List<LibraryDTO> getLibList(@Auth UserInfo userInfo,
									   @Valid @NotNull SearchLibsFormDTO formDTO); @GET @Path("search/lib_list/maven") Response getMavenArtifactInfo(@Auth UserInfo userInfo,
										 @LibNameValid @QueryParam("artifact") String artifact);  }### Answer:
@Test public void getLibListFormatted() { when(libraryService.getLibInfo(anyString(), anyString(), anyString())).thenReturn(getLibInfoRecords()); final Response response = resources.getJerseyTest() .target("/infrastructure_provision/exploratory_environment/lib_list/formatted") .queryParam("exploratory_name", "explName") .queryParam("project_name", "projectName") .request() .header("Authorization", "Bearer " + TOKEN) .get(); assertEquals(HttpStatus.SC_OK, response.getStatus()); assertEquals(MediaType.APPLICATION_JSON, response.getHeaderString(HttpHeaders.CONTENT_TYPE)); verify(libraryService).getLibInfo(USER.toLowerCase(), "projectName", "explName"); verifyNoMoreInteractions(libraryService); }