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);
}
Aggregations