### Question:
SW360RestHealthIndicator implements HealthIndicator { protected DatabaseInstance makeDatabaseInstance() throws MalformedURLException { return new DatabaseInstance(DatabaseSettings.getConfiguredHttpClient().get()); }  @Override Health health();  }### Answer:
@Test public void health_should_return_503_with_throwable() throws MalformedURLException { final DatabaseInstance databaseInstanceMock = mock(DatabaseInstance.class); when(databaseInstanceMock.checkIfDbExists(anyString())) .thenThrow(new RuntimeException()); when(restHealthIndicatorMock.makeDatabaseInstance()) .thenReturn(databaseInstanceMock); ResponseEntity<Map> entity = getMapResponseEntityForHealthEndpointRequest("/health"); then(entity.getStatusCode()).isEqualTo(HttpStatus.SERVICE_UNAVAILABLE); final LinkedHashMap sw360Rest = (LinkedHashMap<String, Object>) entity.getBody().get("SW360Rest"); final LinkedHashMap restState = (LinkedHashMap<String, Object>) sw360Rest.get("Rest State"); assertFalse((boolean) restState.get(IS_DB_REACHABLE)); assertNotNull(sw360Rest.get("error")); }