DatabasesResource { @GET @Produces(MediaType.APPLICATION_JSON) public Response getAllDatabases() { if (LOG.isDebugEnabled()) { LOG.debug("Client sent retrieve all databases request."); } Response response = null; try { initializeContext(); response = JerseyResourceDelegateUtil.runJerseyResourceDelegate( new GetAllDatabasesDelegate(), application, context, LOG); } catch (Throwable e) { LOG.error(e.getMessage(), e); response = ResourcesUtil.createExceptionResponse(null, e.getMessage()); } return response; }  @GET @Produces(MediaType.APPLICATION_JSON) Response getAllDatabases(); @POST @Consumes(MediaType.APPLICATION_JSON) Response createNewDatabase(NewDatabaseRequest request); @GET @Path("/{databaseName}") @Produces(MediaType.APPLICATION_JSON) Response getDatabase(@PathParam("databaseName") String databaseName); @DELETE @Path("/{databaseName}") Response deleteDatabase(@PathParam("databaseName") String databaseName);  }
@Test public void testGetAllDatabases() throws Exception { Map<String, Collection<String>> databaseNames = restClient.target(databasesURI) .request().get(new GenericType<Map<String, Collection<String>>>(Map.class)); assertNotNull(databaseNames); assertFalse(databaseNames.isEmpty()); assertNotNull(databaseNames.get("databases")); Collection<String> databaseNamesCollection = databaseNames.get("databases"); assertTrue(databaseNamesCollection.contains(TajoConstants.DEFAULT_DATABASE_NAME)); }