@Test
    void verifyObserveError() {
        val monitor = new AbstractPoolHealthIndicator(500, executor) {
            @Override
            protected Health.Builder checkPool(final Health.Builder builder) {
                throw new IllegalArgumentException("Pool check failed.");
            }

            @Override
            protected int getIdleCount() {
                return 1;
            }

            @Override
            protected int getActiveCount() {
                return 1;
            }
        };
        val health = monitor.health();
        assertEquals(Status.OUT_OF_SERVICE, health.getStatus());
        assertAll(((DisposableBean) monitor)::destroy);
    }
Unit test for {@link AbstractPoolHealthIndicator} class.

@author Marvin S. Addison
@since 3.5.0
core/cas-server-core-monitor/src/test/java/org/apereo/cas/monitor/PoolHealthIndicatorTests.java