static Supplier<Configuration> initializeConfiguration(Supplier<Configuration> configurationSupplier) {
        try {
            Configuration configuration = configurationSupplier.get();
            return () -> configuration;
        } catch (Exception e) {
            // We have to be careful not to throw anything here as this static block gets executed during plugin scanning and any exceptions will
            // cause the worker to fail during startup, even if it's not configured to use the basic auth extension.
            return () -> {
                throw new ConnectException("Failed to retrieve JAAS configuration", e);
            };
        }
    }
@Test
    public void testGoodJaasConfigInitialization() {
        AtomicBoolean configurationInitializerEvaluated = new AtomicBoolean(false);
        Configuration mockConfiguration = mock(Configuration.class);
        Supplier<Configuration> configuration = BasicAuthSecurityRestExtension.initializeConfiguration(() -> {
            configurationInitializerEvaluated.set(true);
            return mockConfiguration;
        });

        assertTrue(configurationInitializerEvaluated.get());
        assertEquals(mockConfiguration, configuration.get());
    }