@Test public void shouldReturnNewKeyResourceWhenForKeyIsCalled() { KeyResource keyResource = keysResource.forKey("key"); assertThat(keyResource.getKey(), equalTo("key")); }
@Path("/{key:" + KEY_PATTERN + "}") public KeyResource forKey(@PathParam("key") String key) { LOGGER.trace("locate sub-resource:{}", key); return new KeyResource(key, members, distributedStore); }
KeysResource { @Path("/{key:" + KEY_PATTERN + "}") public KeyResource forKey(@PathParam("key") String key) { LOGGER.trace("locate sub-resource:{}", key); return new KeyResource(key, members, distributedStore); } }
KeysResource { @Path("/{key:" + KEY_PATTERN + "}") public KeyResource forKey(@PathParam("key") String key) { LOGGER.trace("locate sub-resource:{}", key); return new KeyResource(key, members, distributedStore); } KeysResource(Set<ClusterMember> members, DistributedStore distributedStore); }
KeysResource { @Path("/{key:" + KEY_PATTERN + "}") public KeyResource forKey(@PathParam("key") String key) { LOGGER.trace("locate sub-resource:{}", key); return new KeyResource(key, members, distributedStore); } KeysResource(Set<ClusterMember> members, DistributedStore distributedStore); @Path("/{key:" + KEY_PATTERN + "}") KeyResource forKey(@PathParam("key") String key); @GET @Produces(MediaType.APPLICATION_JSON) Collection<KeyValue> getAll(); }
KeysResource { @Path("/{key:" + KEY_PATTERN + "}") public KeyResource forKey(@PathParam("key") String key) { LOGGER.trace("locate sub-resource:{}", key); return new KeyResource(key, members, distributedStore); } KeysResource(Set<ClusterMember> members, DistributedStore distributedStore); @Path("/{key:" + KEY_PATTERN + "}") KeyResource forKey(@PathParam("key") String key); @GET @Produces(MediaType.APPLICATION_JSON) Collection<KeyValue> getAll();  }