MutableStatusDetailIndicator implements StatusDetailIndicator { @Override public List<StatusDetail> statusDetails() { return singletonList(statusDetail); } MutableStatusDetailIndicator(final StatusDetail initialStatusDetail); @Override List<StatusDetail> statusDetails(); void update(final StatusDetail statusDetail); void toOk(String message); void toWarning(String message); void toError(String message); void withDetail(String key, String value); void withoutDetail(String key);  }
@Test public void shouldIndicateInitialStatus() { final MutableStatusDetailIndicator indicator = new MutableStatusDetailIndicator(statusDetail("foo", OK, "message")); final StatusDetail statusDetail = indicator.statusDetails().get(0); assertThat(statusDetail.getName(), is("foo")); assertThat(statusDetail.getStatus(), is(OK)); assertThat(statusDetail.getMessage(), is("message")); }