3535import static org .mockito .Mockito .verify ;
3636import static org .mockito .Mockito .when ;
3737import static org .opensearch .dataprepper .plugins .source .otellogs .OtelLogsSourceConfigFixture .createConfigBuilderWithBasicAuth ;
38- import static org .opensearch .dataprepper .plugins .source .otellogs .OtelLogsSourceConfigFixture .createDefaultConfig ;
3938import static org .opensearch .dataprepper .plugins .source .otellogs .OtelLogsSourceConfigFixture .createDefaultConfigBuilder ;
4039import static org .opensearch .dataprepper .plugins .source .otellogs .OtelLogsSourceConfigFixture .createJsonHttpPayload ;
4140import static org .opensearch .dataprepper .plugins .source .otellogs .OtelLogsSourceConfigFixture .createBuilderForConfigWithSsl ;
@@ -173,7 +172,7 @@ public void afterEach() {
173172 }
174173
175174 private void configureSource () {
176- configureSource (createDefaultConfig ());
175+ configureSource (createDefaultConfigBuilder (). httpPath ( CONFIG_HTTP_PATH ). build ());
177176 }
178177
179178 private void configureSource (OTelLogsSourceConfig config ) {
@@ -211,7 +210,7 @@ void httpRequest_writesToBuffer_returnsSuccessfulResponse(String givenPath, Stri
211210
212211 @ Test
213212 void httpsRequest_requestIsProcessed_writesToBufferAndReturnsSuccessfulResponse () throws Exception {
214- configureSource (createBuilderForConfigWithSsl ().build ());
213+ configureSource (createBuilderForConfigWithSsl ().httpPath ( CONFIG_HTTP_PATH ). build ());
215214 SOURCE .start (buffer );
216215 ExportLogsServiceRequest request = createExportLogsRequest ();
217216
@@ -254,7 +253,7 @@ void httpRequest_oneConnectionIsEstablished_metricsReflectCorrectConnectionCount
254253
255254 @ Test
256255 void httpRequest_payloadIsCompressed_returns200 () throws IOException {
257- configureSource ( createDefaultConfigBuilder ().compression (CompressionOption .GZIP ).build ());
256+ configureSource (createDefaultConfigBuilder (). httpPath ( CONFIG_HTTP_PATH ).compression (CompressionOption .GZIP ).build ());
258257 SOURCE .start (buffer );
259258
260259 WebClient .of ().execute (getDefaultRequestHeadersBuilder ()
@@ -271,7 +270,7 @@ void httpRequest_payloadIsCompressed_returns200() throws IOException {
271270 void httpRequest_withBasicAuth_returnsAppropriateResponse (String givenUsername , String givenPassword , HttpStatus expectedStatus , VerificationMode expectedBufferWrites ) throws Exception {
272271 final HttpBasicAuthenticationConfig basicAuthConfig = new HttpBasicAuthenticationConfig (BASIC_AUTH_USERNAME , BASIC_AUTH_PASSWORD );
273272 when (pluginFactory .loadPlugin (eq (GrpcAuthenticationProvider .class ), any (PluginSetting .class ))).thenReturn (new GrpcBasicAuthenticationProvider (basicAuthConfig ));
274- configureSource (createConfigBuilderWithBasicAuth ().build ());
273+ configureSource (createConfigBuilderWithBasicAuth ().httpPath ( CONFIG_HTTP_PATH ). build ());
275274 SOURCE .start (buffer );
276275
277276 final String encodedCredentials = Base64 .getEncoder ().encodeToString (String .format ("%s:%s" , givenUsername , givenPassword ).getBytes (StandardCharsets .UTF_8 ));
@@ -296,7 +295,7 @@ private static Stream<Arguments> getBasicAuthTestData() {
296295 @ ParameterizedTest
297296 @ MethodSource ("getHealthCheckParams" )
298297 void healthCheckRequest_requestIsProcesses_returnsStatusCodeAccordingToConfig (boolean givenHealthCheckConfig , HttpStatus expectedStatus ) throws IOException {
299- configureSource (createDefaultConfigBuilder ().healthCheck (givenHealthCheckConfig ).build ());
298+ configureSource (createDefaultConfigBuilder ().httpPath ( CONFIG_HTTP_PATH ). healthCheck (givenHealthCheckConfig ).build ());
300299 SOURCE .start (buffer );
301300
302301 WebClient .of ().execute (getDefaultRequestHeadersBuilder ()
@@ -344,7 +343,7 @@ void httpRequest_writingToBufferThrowsAnException_correctHttpStatusIsReturned(
344343
345344 @ Test
346345 void httpRequest_requestBodyIsTooLarge_returns413 () throws InvalidProtocolBufferException {
347- configureSource (createDefaultConfigBuilder ().maxRequestLength (ByteCount .ofBytes (4 )).build ());
346+ configureSource (createDefaultConfigBuilder ().httpPath ( CONFIG_HTTP_PATH ). maxRequestLength (ByteCount .ofBytes (4 )).build ());
348347 SOURCE .start (buffer );
349348
350349 WebClient .of ()
0 commit comments