@Test public void getSeeds_notFound(@Mocked final InstanceIdentity identity) throws Exception { final List<String> seeds = ImmutableList.of(); new Expectations() { { priamServer.getInstanceIdentity(); result = identity; times = 1; identity.getSeeds(); result = seeds; times = 1; } }; Response response = resource.getSeeds(); assertEquals(500, response.getStatus()); }
@GET @Path("/get_seeds") public Response getSeeds() { try { final List<String> seeds = priamServer.getInstanceIdentity().getSeeds(); if (!seeds.isEmpty()) { metrics.incGetSeeds(); return Response.ok(StringUtils.join(seeds, ',')).build(); } logger.error("Cannot find the Seeds"); } catch (Exception e) { logger.error("Error while executing get_seeds", e); return Response.serverError().build(); } return Response.status(500).build(); }
CassandraConfig { @GET @Path("/get_seeds") public Response getSeeds() { try { final List<String> seeds = priamServer.getInstanceIdentity().getSeeds(); if (!seeds.isEmpty()) { metrics.incGetSeeds(); return Response.ok(StringUtils.join(seeds, ',')).build(); } logger.error("Cannot find the Seeds"); } catch (Exception e) { logger.error("Error while executing get_seeds", e); return Response.serverError().build(); } return Response.status(500).build(); } }
CassandraConfig { @GET @Path("/get_seeds") public Response getSeeds() { try { final List<String> seeds = priamServer.getInstanceIdentity().getSeeds(); if (!seeds.isEmpty()) { metrics.incGetSeeds(); return Response.ok(StringUtils.join(seeds, ',')).build(); } logger.error("Cannot find the Seeds"); } catch (Exception e) { logger.error("Error while executing get_seeds", e); return Response.serverError().build(); } return Response.status(500).build(); } @Inject  CassandraConfig(PriamServer server, DoubleRing doubleRing, CassMonitorMetrics metrics); }
CassandraConfig { @GET @Path("/get_seeds") public Response getSeeds() { try { final List<String> seeds = priamServer.getInstanceIdentity().getSeeds(); if (!seeds.isEmpty()) { metrics.incGetSeeds(); return Response.ok(StringUtils.join(seeds, ',')).build(); } logger.error("Cannot find the Seeds"); } catch (Exception e) { logger.error("Error while executing get_seeds", e); return Response.serverError().build(); } return Response.status(500).build(); } @Inject  CassandraConfig(PriamServer server, DoubleRing doubleRing, CassMonitorMetrics metrics); @GET @Path("/get_seeds") Response getSeeds(); @GET @Path("/get_token") Response getToken(); @GET @Path("/is_replace_token") Response isReplaceToken(); @GET @Path("/get_replaced_ip") Response getReplacedIp(); @POST @Path("/set_replaced_ip") Response setReplacedIp(@QueryParam("ip") String ip); @GET @Path("/get_extra_env_params") Response getExtraEnvParams(); @GET @Path("/double_ring") Response doubleRing(); }
CassandraConfig { @GET @Path("/get_seeds") public Response getSeeds() { try { final List<String> seeds = priamServer.getInstanceIdentity().getSeeds(); if (!seeds.isEmpty()) { metrics.incGetSeeds(); return Response.ok(StringUtils.join(seeds, ',')).build(); } logger.error("Cannot find the Seeds"); } catch (Exception e) { logger.error("Error while executing get_seeds", e); return Response.serverError().build(); } return Response.status(500).build(); } @Inject  CassandraConfig(PriamServer server, DoubleRing doubleRing, CassMonitorMetrics metrics); @GET @Path("/get_seeds") Response getSeeds(); @GET @Path("/get_token") Response getToken(); @GET @Path("/is_replace_token") Response isReplaceToken(); @GET @Path("/get_replaced_ip") Response getReplacedIp(); @POST @Path("/set_replaced_ip") Response setReplacedIp(@QueryParam("ip") String ip); @GET @Path("/get_extra_env_params") Response getExtraEnvParams(); @GET @Path("/double_ring") Response doubleRing();  }