AdminResources { @GET @Path("/version") public String version() throws IOException, URISyntaxException { return new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("/version"))).readLine(); } AdminResources(NSQLookup nsqLookup); @GET @Path("/version") String version(); @GET @Path("/nsqlookup/{topic : .+}") String lookupTopic(@PathParam("topic") String topic); @POST @Path("/version") void lookupTopic(@QueryParam("host") String host, @QueryParam("port") int port);  }
@Test public void should_return_current_version() throws IOException, URISyntaxException { String versionExpected = new String(Files.readAllBytes(Paths.get(ClassLoader.getSystemResource("version-expected").toURI()))); String version = new AdminResources(null).version(); Assert.assertEquals(versionExpected, version); }