@Test public void getReferenceLibrary() { String network = "someNetwork"; Main.getWorkMgr().initNetwork(network, null); try (Response response = getReferenceLibraryTarget(network).get()) { assertThat(response.getStatus(), equalTo(OK.getStatusCode())); assertThat( response.readEntity(ReferenceLibraryBean.class), equalTo(new ReferenceLibraryBean(new ReferenceLibrary(ImmutableList.of())))); } }
@GET public ReferenceLibraryBean getReferenceLibrary() { _logger.infof("WMS2: getReferenceLibrary '%s'\n", _network); try { return new ReferenceLibraryBean(Main.getWorkMgr().getReferenceLibrary(_network)); } catch (IOException e) { throw new InternalServerErrorException("ReferenceLibrary resource is corrupted"); } }
ReferenceLibraryResource { @GET public ReferenceLibraryBean getReferenceLibrary() { _logger.infof("WMS2: getReferenceLibrary '%s'\n", _network); try { return new ReferenceLibraryBean(Main.getWorkMgr().getReferenceLibrary(_network)); } catch (IOException e) { throw new InternalServerErrorException("ReferenceLibrary resource is corrupted"); } } }
ReferenceLibraryResource { @GET public ReferenceLibraryBean getReferenceLibrary() { _logger.infof("WMS2: getReferenceLibrary '%s'\n", _network); try { return new ReferenceLibraryBean(Main.getWorkMgr().getReferenceLibrary(_network)); } catch (IOException e) { throw new InternalServerErrorException("ReferenceLibrary resource is corrupted"); } } ReferenceLibraryResource(String network); }
ReferenceLibraryResource { @GET public ReferenceLibraryBean getReferenceLibrary() { _logger.infof("WMS2: getReferenceLibrary '%s'\n", _network); try { return new ReferenceLibraryBean(Main.getWorkMgr().getReferenceLibrary(_network)); } catch (IOException e) { throw new InternalServerErrorException("ReferenceLibrary resource is corrupted"); } } ReferenceLibraryResource(String network); @Deprecated @POST Response addReferenceBook(ReferenceBookBean referenceBookBean); @Path("/{book}") ReferenceBookResource getReferenceBookResource(@PathParam("book") String book); @GET ReferenceLibraryBean getReferenceLibrary(); }
ReferenceLibraryResource { @GET public ReferenceLibraryBean getReferenceLibrary() { _logger.infof("WMS2: getReferenceLibrary '%s'\n", _network); try { return new ReferenceLibraryBean(Main.getWorkMgr().getReferenceLibrary(_network)); } catch (IOException e) { throw new InternalServerErrorException("ReferenceLibrary resource is corrupted"); } } ReferenceLibraryResource(String network); @Deprecated @POST Response addReferenceBook(ReferenceBookBean referenceBookBean); @Path("/{book}") ReferenceBookResource getReferenceBookResource(@PathParam("book") String book); @GET ReferenceLibraryBean getReferenceLibrary();  }