MetaStoreRestApi { @GET @Path("/database") @SubmarineApi public Response getDatabase(@QueryParam("database") String name) { Database database; try { database = submarineMetaStore.getDatabase(name); } catch (NoSuchObjectException e) { LOG.error(e.getMessage(), e); return new JsonResponse.Builder<String>(Response.Status.NOT_FOUND) .success(false).build(); } return new JsonResponse.Builder<Database>(Response.Status.OK) .success(true).result(database).build(); } @Inject  MetaStoreRestApi(); @POST @Path("/database/create") @SubmarineApi Response createDatabase(@QueryParam("database") String databaseJson); @POST @Path("/table/create") @SubmarineApi Response createTable(@QueryParam("database") String tableJson); @GET @Path("/database/count") @SubmarineApi Response getDatabaseCount(); @GET @Path("/database/list") @SubmarineApi Response listDatabases(); @GET @Path("/database") @SubmarineApi Response getDatabase(@QueryParam("database") String name); @DELETE @Path("/database") @SubmarineApi Response dropDatabase(@QueryParam("database") String name); @GET @Path("/table/list") @SubmarineApi Response listTables(@QueryParam("database") String databaseName); @GET @Path("/table/count") @SubmarineApi Response getTableCount(); @GET @Path("/table") @SubmarineApi Response getTable(@QueryParam("database") String databaseName,
                           @QueryParam("table") String tableName); @DELETE @Path("/table") @SubmarineApi Response dropTable(@QueryParam("database") String databaseName,
                            @QueryParam("table") String tableName);  }
@Test public void getDatabase() { Response response = metaStoreApi.getDatabase("testdb"); assertEquals(response.getStatus(), Response.Status.OK.getStatusCode()); assertTrue(((String) response.getEntity()).contains("testdb")); }