Search in sources :

Example 1 with ArmeriaHttpAuthenticationProvider

use of com.amazon.dataprepper.armeria.authentication.ArmeriaHttpAuthenticationProvider in project data-prepper by opensearch-project.

the class HTTPSourceTest method setUp.

@BeforeEach
public void setUp() {
    lenient().when(serverBuilder.annotatedService(any())).thenReturn(serverBuilder);
    lenient().when(serverBuilder.http(anyInt())).thenReturn(serverBuilder);
    lenient().when(serverBuilder.https(anyInt())).thenReturn(serverBuilder);
    lenient().when(serverBuilder.build()).thenReturn(server);
    lenient().when(server.start()).thenReturn(completableFuture);
    sourceConfig = mock(HTTPSourceConfig.class);
    lenient().when(sourceConfig.getPort()).thenReturn(2021);
    lenient().when(sourceConfig.getRequestTimeoutInMillis()).thenReturn(10_000);
    lenient().when(sourceConfig.getThreadCount()).thenReturn(200);
    lenient().when(sourceConfig.getMaxConnectionCount()).thenReturn(500);
    lenient().when(sourceConfig.getMaxPendingRequests()).thenReturn(1024);
    lenient().when(sourceConfig.hasHealthCheckService()).thenReturn(true);
    MetricsTestUtil.initMetrics();
    pluginMetrics = PluginMetrics.fromNames(PLUGIN_NAME, TEST_PIPELINE_NAME);
    pluginFactory = mock(PluginFactory.class);
    final ArmeriaHttpAuthenticationProvider authenticationProvider = mock(ArmeriaHttpAuthenticationProvider.class);
    when(pluginFactory.loadPlugin(eq(ArmeriaHttpAuthenticationProvider.class), any(PluginSetting.class))).thenReturn(authenticationProvider);
    testBuffer = getBuffer();
    HTTPSourceUnderTest = new HTTPSource(sourceConfig, pluginMetrics, pluginFactory);
}
Also used : ArmeriaHttpAuthenticationProvider(com.amazon.dataprepper.armeria.authentication.ArmeriaHttpAuthenticationProvider) PluginFactory(com.amazon.dataprepper.model.plugin.PluginFactory) PluginSetting(com.amazon.dataprepper.model.configuration.PluginSetting) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ArmeriaHttpAuthenticationProvider (com.amazon.dataprepper.armeria.authentication.ArmeriaHttpAuthenticationProvider)1 PluginSetting (com.amazon.dataprepper.model.configuration.PluginSetting)1 PluginFactory (com.amazon.dataprepper.model.plugin.PluginFactory)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1