AbstractOaiPmhServerInfoRestEndpoint { @GET @Path("/hasrepo/{repoId}") @Produces(MediaType.TEXT_PLAIN) @RestQuery(name = "hasRepo", description = "Ask if the OAI-PMH server knows about a repository", returnDescription = "true|false", pathParameters = { @RestParameter(name = "repoId", isRequired = true, description = "The id of the repository", type = RestParameter.Type.STRING)}, responses = { @RestResponse(responseCode = SC_OK, description = "true|false")}) public Response hasRepo(@PathParam("repoId") String repoId) { return ok(getOaiPmhServerInfo().hasRepo(repoId)); }  abstract OaiPmhServerInfo getOaiPmhServerInfo(); @GET @Path("/hasrepo/{repoId}") @Produces(MediaType.TEXT_PLAIN) @RestQuery(name = "hasRepo", description = "Ask if the OAI-PMH server knows about a repository", returnDescription = "true|false", pathParameters = { @RestParameter(name = "repoId", isRequired = true, description = "The id of the repository", type = RestParameter.Type.STRING)}, responses = { @RestResponse(responseCode = SC_OK, description = "true|false")}) Response hasRepo(@PathParam("repoId") String repoId); @GET @Path("/mountpoint") @Produces(MediaType.TEXT_PLAIN) @RestQuery(name = "mountPoint", description = "Ask for the mount point of the OAI-PMH server", returnDescription = "The mount point", responses = { @RestResponse(responseCode = SC_OK, description = "The mount point")}) Response getMountPoint();  }
@Test public void testHasRepo() throws Exception { given().pathParam("repoId", "UNKNOWN") .expect() .statusCode(HttpStatus.SC_OK) .body(equalTo("false")) .when().get(env.host("/hasrepo/{repoId}")); given().pathParam("repoId", "default") .expect() .statusCode(HttpStatus.SC_OK) .body(equalTo("true")) .when().get(env.host("/hasrepo/{repoId}")); }