Notify user about results of manually executed health check (#2044)

When manually starting health checks, the user should always receive a notification about the status, whether successful or not.
This commit is contained in:
Florian Scholdei
2022-05-25 09:30:45 +02:00
committed by GitHub
parent bd68c301ea
commit 6216945f0d
5 changed files with 22 additions and 11 deletions

View File

@@ -119,6 +119,7 @@ class HealthCheckerTest {
@Test
void shouldComputeLightChecks() {
when(subject.getPrincipal()).thenReturn("trillian");
when(healthCheck1.check(repository)).thenReturn(HealthCheckResult.unhealthy(createFailure("error1")));
when(healthCheck2.check(repository)).thenReturn(HealthCheckResult.unhealthy(createFailure("error2")));
@@ -261,8 +262,8 @@ class HealthCheckerTest {
checker.fullCheck(repositoryId);
verify(notificationSender, never()).send(any());
verify(notificationSender,times(1)).send(any(), eq("trillian"));
verify(notificationSender, times(1)).send(any());
verify(notificationSender, never()).send(any(), eq("trillian"));
}
@Test
@@ -274,7 +275,7 @@ class HealthCheckerTest {
checker.fullCheck(repositoryId);
verify(notificationSender).send(any(), eq("trillian"));
verify(notificationSender).send(any());
verify(notificationSender).send(any(), eq("Arthur"));
}
}