@Test @SuppressWarnings("unchecked") public void get() { List<Map<String, Object>> status = (List<Map<String, Object>>) endpoint.get(); Assert.assertEquals(2, status.size()); for (Map<String, Object> s : status) { switch (s.get("name").toString()) { case "running-service": Assert.assertEquals(Boolean.TRUE, s.get("healthy")); Assert.assertEquals(State.RUNNING.name(), s.get("state")); break; case "stopping-service": Assert.assertEquals(Boolean.FALSE, s.get("healthy")); Assert.assertEquals(State.STOPPING.name(), s.get("state")); break; default: Assert.fail(); break; } } }
@Override public Object get() { return manager.services() .stream() .map(this::toMap) .collect(Collectors.toList()); }
ServicesEndpoint implements HttpEndpoint { @Override public Object get() { return manager.services() .stream() .map(this::toMap) .collect(Collectors.toList()); } }
ServicesEndpoint implements HttpEndpoint { @Override public Object get() { return manager.services() .stream() .map(this::toMap) .collect(Collectors.toList()); } @Inject  ServicesEndpoint(ServiceManager manager); }
ServicesEndpoint implements HttpEndpoint { @Override public Object get() { return manager.services() .stream() .map(this::toMap) .collect(Collectors.toList()); } @Inject  ServicesEndpoint(ServiceManager manager); @Override Object get(); @Override Object get(String path); }
ServicesEndpoint implements HttpEndpoint { @Override public Object get() { return manager.services() .stream() .map(this::toMap) .collect(Collectors.toList()); } @Inject  ServicesEndpoint(ServiceManager manager); @Override Object get(); @Override Object get(String path);  }