use of com.amazon.dataprepper.pipeline.server.DataPrepperCoreAuthenticationProvider in project data-prepper by opensearch-project.
the class DataPrepperServerConfigurationTest method testGivenPluginFactoryAndPluginSettingsThenCreateAuthenticationProvider.
@Test
public void testGivenPluginFactoryAndPluginSettingsThenCreateAuthenticationProvider() {
final PluginFactory pluginFactory = mock(PluginFactory.class);
final PluginSetting pluginSetting = mock(PluginSetting.class);
final DataPrepperCoreAuthenticationProvider expected = mock(DataPrepperCoreAuthenticationProvider.class);
when(pluginFactory.loadPlugin(eq(DataPrepperCoreAuthenticationProvider.class), eq(pluginSetting))).thenReturn(expected);
final DataPrepperCoreAuthenticationProvider authenticationProvider = serverConfiguration.authenticationProvider(pluginFactory, pluginSetting);
assertThat(authenticationProvider, is(expected));
}
use of com.amazon.dataprepper.pipeline.server.DataPrepperCoreAuthenticationProvider in project data-prepper by opensearch-project.
the class DataPrepperServerConfigurationTest method testGivenGetAuthenticatorReturnsValueThenReturnOptionalContainingValue.
@Test
public void testGivenGetAuthenticatorReturnsValueThenReturnOptionalContainingValue() {
final DataPrepperCoreAuthenticationProvider provider = mock(DataPrepperCoreAuthenticationProvider.class);
final Authenticator authenticatorMock = mock(Authenticator.class);
when(provider.getAuthenticator()).thenReturn(authenticatorMock);
final Authenticator authenticator = serverConfiguration.authenticator(provider);
assertThat(authenticator, is(authenticatorMock));
}
Aggregations