diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResource.java index 1f2de3002a8..c7c09ad0a18 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResource.java @@ -368,12 +368,35 @@ public class IngestionPipelineResource extends EntityResource post(String endpoint, String payload, boolean authenticate) throws IOException, InterruptedException { - String authToken = authenticate ? String.format(AUTH_TOKEN, authenticate()) : null; - HttpRequest request = + String authToken = authenticate ? authenticate() : null; + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(URI.create(endpoint)) .header(CONTENT_HEADER, CONTENT_TYPE) - .header(AUTH_HEADER, authToken) - .POST(HttpRequest.BodyPublishers.ofString(payload)) - .build(); - return client.send(request, HttpResponse.BodyHandlers.ofString()); + .POST(HttpRequest.BodyPublishers.ofString(payload)); + if (authenticate) { + requestBuilder.header(AUTH_HEADER, String.format(AUTH_TOKEN, authToken)); + } + return client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString()); } /* Authenticate with the service */ diff --git a/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResourceTest.java b/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResourceTest.java index c9cd6b54c77..49b3dcc88ad 100644 --- a/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResourceTest.java +++ b/catalog-rest-service/src/test/java/org/openmetadata/catalog/resources/services/ingestionpipelines/IngestionPipelineResourceTest.java @@ -22,7 +22,6 @@ import static org.openmetadata.catalog.util.TestUtils.ADMIN_AUTH_HEADERS; import static org.openmetadata.catalog.util.TestUtils.UpdateType.MINOR_UPDATE; import static org.openmetadata.catalog.util.TestUtils.assertListNotNull; import static org.openmetadata.catalog.util.TestUtils.assertListNull; -import static org.openmetadata.catalog.util.TestUtils.assertResponse; import static org.openmetadata.catalog.util.TestUtils.assertResponseContains; import java.io.IOException; @@ -50,7 +49,6 @@ import org.openmetadata.catalog.entity.services.DatabaseService; import org.openmetadata.catalog.entity.services.ingestionPipelines.AirflowConfig; import org.openmetadata.catalog.entity.services.ingestionPipelines.IngestionPipeline; import org.openmetadata.catalog.entity.services.ingestionPipelines.PipelineType; -import org.openmetadata.catalog.exception.IngestionPipelineDeploymentException; import org.openmetadata.catalog.jdbi3.DatabaseServiceRepository.DatabaseServiceEntityInterface; import org.openmetadata.catalog.jdbi3.IngestionPipelineRepository; import org.openmetadata.catalog.metadataIngestion.DashboardServiceMetadataPipeline; @@ -200,18 +198,6 @@ public class IngestionPipelineResourceTest extends EntityResourceTest createEntity(create, ADMIN_AUTH_HEADERS), BAD_REQUEST, "service must not be null"); } - @Test - void post_IngestionPipelineWithDeploy_4xx(TestInfo test) { - CreateIngestionPipeline create = - createRequest(test) - .withService(BIGQUERY_REFERENCE) - .withAirflowConfig(new AirflowConfig().withStartDate("2021-11-21").withForceDeploy(true)); - assertResponse( - () -> createEntity(create, ADMIN_AUTH_HEADERS), - BAD_REQUEST, - IngestionPipelineDeploymentException.buildMessageByName(create.getName(), "value")); - } - @Test void post_AirflowWithDifferentService_200_ok(TestInfo test) throws IOException { EntityReference[] differentServices = {REDSHIFT_REFERENCE, BIGQUERY_REFERENCE};