@Override
    public void register(ConnectRestExtensionContext restPluginContext) {
        log.trace("Registering JAAS basic auth filter");
        restPluginContext.configurable().register(new JaasBasicAuthFilter(configuration.get()));
        log.trace("Finished registering JAAS basic auth filter");
    }
@SuppressWarnings("unchecked")
    @Test
    public void testJaasConfigurationNotOverwritten() {
        ArgumentCaptor<JaasBasicAuthFilter> jaasFilter = ArgumentCaptor.forClass(JaasBasicAuthFilter.class);
        Configurable<? extends Configurable<?>> configurable = mock(Configurable.class);
        when(configurable.register(jaasFilter.capture())).thenReturn(null);

        ConnectRestExtensionContext context = mock(ConnectRestExtensionContext.class);
        when(context.configurable()).thenReturn((Configurable) configurable);

        BasicAuthSecurityRestExtension extension = new BasicAuthSecurityRestExtension();
        Configuration overwrittenConfiguration = mock(Configuration.class);
        Configuration.setConfiguration(overwrittenConfiguration);
        extension.register(context);

        assertNotEquals(overwrittenConfiguration, jaasFilter.getValue().configuration,
            "Overwritten JAAS configuration should not be used by basic auth REST extension");
    }