Skip to content
Snippets Groups Projects
Commit c858ebab authored by Kelly Zhou's avatar Kelly Zhou
Browse files

Merge branch 'update-cron-job' into 'master'

temprorially disable publishing legaltag status change events

See merge request !231
parents 4397dd36 e1a7126e
No related branches found
No related tags found
2 merge requests!265Update core-lib-gcp to use universal auth token requester, refactor mappers...,!231temprorially disable publishing legaltag status change events
Pipeline #112516 failed
......@@ -29,9 +29,10 @@ public class LegalTagStatusJob {
validator.setHeaders(headers);
statusChangedTags = checkAndUpdateLegalTagStatus(true, tenantName, statusChangedTags);
statusChangedTags = checkAndUpdateLegalTagStatus(false, tenantName, statusChangedTags);
if (!statusChangedTags.getStatusChangedTags().isEmpty()) {
legalTagPublisher.publish(projectId, headers, statusChangedTags);
}
//TODO: Uncomment following event publishing method after this issue is resolved: https://community.opengroup.org/osdu/platform/system/storage/-/issues/117
//publishLegalTagStatusUpdateEvents(!statusChangedTags.getStatusChangedTags().isEmpty(), projectId, headers, statusChangedTags);
return statusChangedTags;
}
......@@ -50,4 +51,10 @@ public class LegalTagStatusJob {
}
return statusChangedTags;
}
private void publishLegalTagStatusUpdateEvents(boolean hasStatusChanges, String projectId, DpsHeaders headers, StatusChangedTags statusChangedTags) throws Exception {
if (hasStatusChanges) {
legalTagPublisher.publish(projectId, headers, statusChangedTags);
}
}
}
package org.opengroup.osdu.legal.jobs;
import org.junit.Ignore;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.legal.StatusChangedTags;
import org.opengroup.osdu.legal.logging.AuditLogger;
......@@ -88,6 +89,7 @@ public class LegalTagStatusJobTests {
assertEquals(LegalTagCompliance.incompliant, result.getStatusChangedTags().get(0).getChangedTagStatus());
}
@Ignore("https://community.opengroup.org/osdu/platform/system/storage/-/issues/117")
@Test
public void should_sendLegalTagNameAndNewStatusWithCorrelationIdToPubSub_when_legalTagBecomesIncompliant() throws
Exception {
......@@ -103,6 +105,7 @@ public class LegalTagStatusJobTests {
verify(messagePublisherMock, times(1)).publish(any(), any(), any());
}
@Ignore("https://community.opengroup.org/osdu/platform/system/storage/-/issues/117")
@Test
public void should_notSendMessageToPubSub_when_noLegalTagStatusHasChanged() throws Exception {
Collection<LegalTag> validLegalTags = new ArrayList<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment