From 31f60bebfe8bbd1fe004e94c7bc7b31b0dcc704f Mon Sep 17 00:00:00 2001
From: pliao-hmcts <113367232+pliao-hmcts@users.noreply.github.com>
Date: Thu, 7 Dec 2023 11:18:24 +0000
Subject: [PATCH] CIV-11764 remove failed event emitter scheduler (#797)
Co-authored-by: vasudevganesanhmcts <100689363+vasudevganesanhmcts@users.noreply.github.com>
---
...cation_failed_event_emitter_scheduler.bpmn | 42 ------------
...cationFailedEventEmitterSchedulerTest.java | 64 -------------------
2 files changed, 106 deletions(-)
delete mode 100644 src/main/resources/camunda/general_application_failed_event_emitter_scheduler.bpmn
delete mode 100644 src/test/java/uk/gov/hmcts/reform/civil/bpmn/GeneralApplicationFailedEventEmitterSchedulerTest.java
diff --git a/src/main/resources/camunda/general_application_failed_event_emitter_scheduler.bpmn b/src/main/resources/camunda/general_application_failed_event_emitter_scheduler.bpmn
deleted file mode 100644
index 8e9784b5d..000000000
--- a/src/main/resources/camunda/general_application_failed_event_emitter_scheduler.bpmn
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
- Flow_1gnbmqe
- Flow_0tjw87e
-
-
- Flow_0tjw87e
-
-
-
-
- Flow_1gnbmqe
-
- 0 0/30 * * * ?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/GeneralApplicationFailedEventEmitterSchedulerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/bpmn/GeneralApplicationFailedEventEmitterSchedulerTest.java
deleted file mode 100644
index c9998a513..000000000
--- a/src/test/java/uk/gov/hmcts/reform/civil/bpmn/GeneralApplicationFailedEventEmitterSchedulerTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package uk.gov.hmcts.reform.civil.bpmn;
-
-import org.camunda.bpm.engine.externaltask.ExternalTask;
-import org.camunda.bpm.engine.externaltask.LockedExternalTask;
-import org.camunda.bpm.engine.impl.calendar.CronExpression;
-import org.camunda.bpm.engine.management.JobDefinition;
-import org.junit.jupiter.api.Test;
-
-import java.text.ParseException;
-import java.time.LocalDateTime;
-import java.util.List;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-
-class GeneralApplicationFailedEventEmitterSchedulerTest extends BpmnBaseTest {
-
- public static final String TOPIC_NAME = "GAFailedEventEmitterScheduler";
-
- public GeneralApplicationFailedEventEmitterSchedulerTest() {
- super("general_application_failed_event_emitter_scheduler.bpmn",
- "GAFailedEventEmitterScheduler");
- }
-
- @Test
- void pollingEventBmpnShouldFirePollingEventEmmiterExternalTask_whenStarted() throws ParseException {
- //assert process has started
- assertFalse(processInstance.isEnded());
-
- //assert topic names
- assertThat(getTopics()).containsOnly(TOPIC_NAME);
-
- //get jobs
- List jobDefinitions = getJobs();
-
- //assert that job is as expected
- assertThat(jobDefinitions).hasSize(1);
- assertThat(jobDefinitions.get(0).getJobType()).isEqualTo("timer-start-event");
-
- String cronString = "0 0/30 * * * ?";
- assertThat(jobDefinitions.get(0).getJobConfiguration()).isEqualTo("CYCLE: " + cronString);
- assertCronTriggerFiresAtExpectedTime(
- new CronExpression(cronString),
- LocalDateTime.of(2020, 1, 9, 0, 0, 0),
- LocalDateTime.of(2020, 1, 9, 0, 30, 0)
- );
-
- //get external tasks
- List externalTasks = getExternalTasks();
- assertThat(externalTasks).hasSize(1);
-
- //fetch and complete task
- List lockedExternalTasks = fetchAndLockTask(TOPIC_NAME);
- assertThat(lockedExternalTasks).hasSize(1);
- completeTask(lockedExternalTasks.get(0).getId());
-
- //assert no external tasks left
- List externalTasksAfter = getExternalTasks();
- assertThat(externalTasksAfter).isEmpty();
-
- //assert process is still active - timer event so always running
- assertFalse(processInstance.isEnded());
- }
-}