From 1a8b7e5948b63f5de27783a824fc82d202b6b162 Mon Sep 17 00:00:00 2001 From: "im.b" Date: Wed, 3 Jan 2024 16:15:29 +0900 Subject: [PATCH 1/2] Remove unused delayed health check API --- .../home/controller/HealthCheckApiController.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ngrinder-controller/src/main/java/org/ngrinder/home/controller/HealthCheckApiController.java b/ngrinder-controller/src/main/java/org/ngrinder/home/controller/HealthCheckApiController.java index 989eec3557..f53caa42fb 100644 --- a/ngrinder-controller/src/main/java/org/ngrinder/home/controller/HealthCheckApiController.java +++ b/ngrinder-controller/src/main/java/org/ngrinder/home/controller/HealthCheckApiController.java @@ -64,19 +64,4 @@ public Map healthCheck(HttpServletResponse response) { map.put("regions", regionService.getAll()); return map; } - - /** - * Return health check message with 1 sec delay. If there is shutdown lock, - * it returns 503. Otherwise, it returns region lists. - * - * @param sleep in milliseconds. - * @param response response - * @return region list - */ - @GetMapping("/check/healthcheck_slow") - public Map healthCheckSlowly(@RequestParam(value = "delay", defaultValue = "1000") int sleep, - HttpServletResponse response) { - ThreadUtils.sleep(sleep); - return healthCheck(response); - } } From 622d9ceb5cb8170322bf5ac0c19268a5b7dee9f5 Mon Sep 17 00:00:00 2001 From: "im.b" Date: Fri, 5 Jan 2024 16:03:50 +0900 Subject: [PATCH 2/2] Fix test --- .../java/org/ngrinder/home/controller/HomeControllerTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ngrinder-controller/src/test/java/org/ngrinder/home/controller/HomeControllerTest.java b/ngrinder-controller/src/test/java/org/ngrinder/home/controller/HomeControllerTest.java index 8897dd6e29..091cd5ec2f 100644 --- a/ngrinder-controller/src/test/java/org/ngrinder/home/controller/HomeControllerTest.java +++ b/ngrinder-controller/src/test/java/org/ngrinder/home/controller/HomeControllerTest.java @@ -65,8 +65,7 @@ public void testHome() { @Test public void testHealthCheck() { MockHttpServletResponse res = new MockHttpServletResponse(); - healthCheckApiController.healthCheck(res); - Map message = healthCheckApiController.healthCheckSlowly(500, res); + Map message = healthCheckApiController.healthCheck(res); assertEquals(message.get("current"), regionService.getCurrent()); }