Skip to content

Commit

Permalink
Revert "Test investigation loop issue #2 (#27)"
Browse files Browse the repository at this point in the history
This reverts commit feac464.
  • Loading branch information
sveselev committed Aug 30, 2024
1 parent feac464 commit 4ba3894
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Build-and-deploy-reporting-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
- rel-**
# Uncomment the following line only to test the build deploy from private branches.
- CNDIT-*
# - CNDIT-*
paths-ignore:
- "docker-compose.yml"
- "**.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ public String processInvestigation(String value) {
InvestigationTransformed investigationTransformed = processDataUtil.transformInvestigationData(investigation);
buildReportingModelForTransformedData(reportingModel, investigationTransformed);
pushKeyValuePairToKafka(investigationKey, reportingModel, investigationTopicReporting);

//ToDo: Revert this after the loop debugging issue
// only process and send notifications when investigation data has been sent
// only process and send notifications when investigation data has been sent
/* .whenComplete((res, ex) ->
logger.info("Investigation data (uid={}) sent to {}", investigation.getPublicHealthCaseUid(), investigationTopicReporting))
.thenRunAsync(() -> processDataUtil.processNotifications(investigation.getInvestigationNotifications(), objectMapper))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ public void processNotifications(String investigationNotifications, ObjectMapper

String jsonKey = jsonGenerator.generateStringJson(investigationNotificationsKey);
String jsonValue = jsonGenerator.generateStringJson(tempInvestigationNotificationsObject);
// ToDo: Revert this
// kafkaTemplate.send(investigationNotificationsOutputTopicName, jsonKey, jsonValue)
// .whenComplete((res, e) -> logger.info("Notification data (uid={}) sent to {}", notificationUid, investigationNotificationsOutputTopicName));
kafkaTemplate.send(investigationNotificationsOutputTopicName, jsonKey, jsonValue)
.whenComplete((res, e) -> logger.info("Notification data (uid={}) sent to {}", notificationUid, investigationNotificationsOutputTopicName));
}
}
else {
Expand Down Expand Up @@ -187,8 +186,7 @@ private void transformObservationIds(String observationNotificationIds, Investig
for(Long id : observationIds) {
investigationObservation.setObservationId(id);
String jsonValue = jsonGenerator.generateStringJson(investigationObservation);
//ToDo: Revert this after the loop debugging issue
// kafkaTemplate.send(investigationObservationOutputTopicName, jsonValue, jsonValue);
kafkaTemplate.send(investigationObservationOutputTopicName, jsonValue, jsonValue);
}
}
else {
Expand Down Expand Up @@ -244,8 +242,7 @@ private void transformInvestigationConfirmationMethod(String investigationConfir
investigationConfirmationMethodKey.setConfirmationMethodCd(key);
String jsonKey = jsonGenerator.generateStringJson(investigationConfirmationMethodKey);
String jsonValue = jsonGenerator.generateStringJson(investigationConfirmation);
//ToDo: Revert this after the loop debugging issue
// kafkaTemplate.send(investigationConfirmationOutputTopicName, jsonKey, jsonValue);
kafkaTemplate.send(investigationConfirmationOutputTopicName, jsonKey, jsonValue);
}
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import gov.cdc.etldatapipeline.investigation.repository.model.dto.*;
import gov.cdc.etldatapipeline.investigation.repository.rdb.InvestigationCaseAnswerRepository;
import gov.cdc.etldatapipeline.investigation.util.ProcessInvestigationDataUtil;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
Expand All @@ -28,7 +27,6 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.*;

@Ignore
class InvestigationDataProcessingTests {
@Mock
KafkaTemplate<String, String> kafkaTemplate;
Expand Down Expand Up @@ -65,8 +63,7 @@ void setUp() {
transformer = new ProcessInvestigationDataUtil(kafkaTemplate, investigationCaseAnswerRepository);
}

@Ignore
//@Test
@Test
void testConfirmationMethod() {
Investigation investigation = new Investigation();

Expand Down Expand Up @@ -102,7 +99,7 @@ void testConfirmationMethod() {
assertTrue(containsWords.apply(messageCaptor.getValue(), cmDetailsFn.apply(confirmationMethod)));
}

//@Test
@Test
void testObservationNotificationIds() {
Investigation investigation = new Investigation();

Expand All @@ -127,7 +124,7 @@ void testObservationNotificationIds() {
assertTrue(containsWords.apply(actualCombined, oDetailsFn.apply(observation)));
}

// @Test
@Test
void testNotifications() {
Investigation investigation = new Investigation();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import gov.cdc.etldatapipeline.investigation.repository.model.reporting.InvestigationReporting;
import gov.cdc.etldatapipeline.investigation.repository.rdb.InvestigationCaseAnswerRepository;
import gov.cdc.etldatapipeline.investigation.util.ProcessInvestigationDataUtil;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
Expand All @@ -24,7 +23,6 @@
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

@Ignore
class InvestigationServiceTest {

@Mock
Expand Down Expand Up @@ -54,7 +52,7 @@ void setUp() {
transformer = new ProcessInvestigationDataUtil(kafkaTemplate, investigationCaseAnswerRepository);
}

// @Test
@Test
void testProcessMessage() {
String investigationTopic = "Investigation";
String investigationTopicOutput = "InvestigationOutput";
Expand Down

0 comments on commit 4ba3894

Please sign in to comment.