@Override
    public Health health() {
        final Health.Builder health = Health.unknown();
        if (!jobRunrProperties.getBackgroundJobServer().isEnabled()) {
            health
                    .up()
                    .withDetail("backgroundJobServer", "disabled");
        } else {
            final BackgroundJobServer backgroundJobServer = backgroundJobServerProvider.getObject();
            if (backgroundJobServer.isRunning()) {
                health
                        .up()
                        .withDetail("backgroundJobServer", "enabled")
                        .withDetail("backgroundJobServerStatus", "running");
            } else {
                health
                        .down()
                        .withDetail("backgroundJobServer", "enabled")
                        .withDetail("backgroundJobServerStatus", "stopped");
            }
        }
        return health.build();
    }
@Test
    void givenEnabledBackgroundJobServerAndBackgroundJobServerStopped_ThenHealthIsDown() {
        when(backgroundJobServerProperties.isEnabled()).thenReturn(true);
        when(backgroundJobServer.isRunning()).thenReturn(false);

        assertThat(jobRunrHealthIndicator.health().getStatus()).isEqualTo(Status.DOWN);
    }