+ }
+
+ private void putService(String name) {
+ String url = baseUrl() + "/service";
+
+ ServiceRegistrationInfo service = ImmutableServiceRegistrationInfo.builder() //
+ .keepAliveInterval(1) //
+ .name(name) //
+ .build();
+ String json = gson.toJson(service);
+ this.restTemplate.put(url, json);
+ }
+
+ @Test
+ public void putAndGetService() throws Exception {
+ putService("name");
+
+ String url = baseUrl() + "/service?name=name";
+ String rsp = this.restTemplate.getForObject(url, String.class);
+ ServiceStatus status = gson.fromJson(rsp, ImmutableServiceStatus.class);
+ assertThat(status.keepAliveInterval() == 1);
+ assertThat(status.name().equals("name"));
+
+ url = baseUrl() + "/services";
+ rsp = this.restTemplate.getForObject(url, String.class);
+ assertThat(rsp.contains("name"));
+ System.out.println(rsp);