diff --git a/provider/partition-ibm/src/main/java/org/opengroup/osdu/partition/provider/ibm/service/PartitionServiceImpl.java b/provider/partition-ibm/src/main/java/org/opengroup/osdu/partition/provider/ibm/service/PartitionServiceImpl.java index 76a227f302f1a1521be22ceb9ddedfca849b9e26..e1ac331b89fa3ce72ccff75ade6f8bd4adf02332 100644 --- a/provider/partition-ibm/src/main/java/org/opengroup/osdu/partition/provider/ibm/service/PartitionServiceImpl.java +++ b/provider/partition-ibm/src/main/java/org/opengroup/osdu/partition/provider/ibm/service/PartitionServiceImpl.java @@ -99,15 +99,11 @@ public class PartitionServiceImpl implements IPartitionService { PartitionInfo pi; PartitionDoc partitionDoc = new PartitionDoc(partitionId, partitionInfo); try { - HttpResponse response = runPipeline(partitionId); - if(response.getResponseCode() != HttpStatus.SC_ACCEPTED || response.getResponseCode() != HttpStatus.SC_CREATED) { - log.error("Response Recieved : "+response.getResponseCode()+"Error occured while triggering pipeline for record-changed-topic-listener [tenant-specific] deployment"); - } db.save(partitionDoc); pi = partitionInfo; } catch (DocumentConflictException e) { - log.error("Partition already exists"); - throw new AppException(e.getStatusCode(), "Conflict", "partition already exists", e); + log.error("{} Partition already exists", partitionId); + throw new AppException(e.getStatusCode(), "Conflict", "partition already exists"); } catch (Exception e) { log.info("Partition creation failed "); e.printStackTrace(); @@ -118,6 +114,15 @@ public class PartitionServiceImpl implements IPartitionService { partitionServiceCache.put(partitionId, pi); partitionListCache.clearAll(); } + + if(partitionId.startsWith("integrationtest") || partitionId.startsWith("common")) { + log.info("this partiton is created through integration test, skipping pipeline trigger"); + return pi; + } + HttpResponse response = runPipeline(partitionId); + if(response.getResponseCode() != HttpStatus.SC_ACCEPTED || response.getResponseCode() != HttpStatus.SC_CREATED) { + log.error("Response Recieved : "+response.getResponseCode()+"Error occured while triggering pipeline for record-changed-topic-listener [tenant-specific] deployment"); + } return pi; }