### Question:
HealthController { @GetMapping public ResponseEntity<Void> isHealthy() { logger.debug("health check"); return new ResponseEntity<>(this.healthService.isHealthy() ? HttpStatus.OK : HttpStatus.INTERNAL_SERVER_ERROR); } @Autowired  HealthController(IHealthService healthService); @GetMapping ResponseEntity<Void> isHealthy();  }### Answer:
@Test public void isHealthyWithWorkingSystemShouldReturnStatus200() { when(healthService.isHealthy()).thenReturn(true); assertEquals(HttpStatus.OK.value(), healthController.isHealthy().getStatusCodeValue()); }
@Test public void isHealthyWithNotWorkingSystemShouldReturnStatus500() { when(healthService.isHealthy()).thenReturn(false); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR.value(), healthController.isHealthy().getStatusCodeValue()); }