SimpleHttpCodeStatusMapper { int getStatusCode(Status status) { return mappings.getOrDefault(status.getCode(), WebEndpointResponse.STATUS_OK); } SimpleHttpCodeStatusMapper();   }
@Test public void testGetStatusCode() { final SimpleHttpCodeStatusMapper mapper = new SimpleHttpCodeStatusMapper(); assertThat(mapper.getStatusCode(Status.UNKNOWN)).isEqualTo(WebEndpointResponse.STATUS_OK); assertThat(mapper.getStatusCode(Status.UP)).isEqualTo(WebEndpointResponse.STATUS_OK); assertThat(mapper.getStatusCode(Status.DOWN)).isEqualTo(WebEndpointResponse.STATUS_SERVICE_UNAVAILABLE); assertThat(mapper.getStatusCode(Status.OUT_OF_SERVICE)) .isEqualTo(WebEndpointResponse.STATUS_SERVICE_UNAVAILABLE); }