refactor: health check

This commit is contained in:
Ilkka Seppälä
2024-04-25 20:18:07 +03:00
parent 63a2740210
commit a2e4307044
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
---
title: Health Check Pattern
title: Health Check
category: Behavioral
language: en
tag:
@@ -82,7 +82,7 @@ class DatabaseTransactionHealthIndicatorTest {
* returns a Health object with Status.UP.
*/
@Test
void whenDatabaseTransactionSucceeds_thenHealthIsUp() {
void whenDatabaseTransactionSucceeds_thenHealthIsUp() throws Exception {
CompletableFuture<Health> future = CompletableFuture.completedFuture(Health.up().build());
when(asynchronousHealthChecker.performCheck(any(Supplier.class), eq(timeoutInSeconds)))
.thenReturn(future);
@@ -104,7 +104,7 @@ class DatabaseTransactionHealthIndicatorTest {
* returns a Health object with Status.DOWN.
*/
@Test
void whenDatabaseTransactionFails_thenHealthIsDown() {
void whenDatabaseTransactionFails_thenHealthIsDown() throws Exception {
CompletableFuture<Health> future = new CompletableFuture<>();
when(asynchronousHealthChecker.performCheck(any(Supplier.class), eq(timeoutInSeconds)))
.thenReturn(future);