From bd72aa14098a9d3784a3d11a2adcd11647d0252c Mon Sep 17 00:00:00 2001 From: Miguel Prieto Date: Thu, 8 Aug 2024 09:28:20 -0400 Subject: [PATCH 1/2] Added zoneId field to Schedule --- .../client/model/SaveScheduleRequest.java | 11 +++++++ .../client/model/WorkflowSchedule.java | 12 ++++++++ .../client/api/SchedulerClientTests.java | 29 +++++++++++++++++-- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/orkes/conductor/client/model/SaveScheduleRequest.java b/src/main/java/io/orkes/conductor/client/model/SaveScheduleRequest.java index 0f6654ff..47ba4efa 100644 --- a/src/main/java/io/orkes/conductor/client/model/SaveScheduleRequest.java +++ b/src/main/java/io/orkes/conductor/client/model/SaveScheduleRequest.java @@ -48,6 +48,9 @@ public class SaveScheduleRequest { @SerializedName("updatedBy") private String updatedBy = null; + @SerializedName("zoneId") // This is just a leftover having used GSON. + private String zoneId; + public SaveScheduleRequest createdBy(String createdBy) { this.createdBy = createdBy; return this; @@ -219,6 +222,14 @@ public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; } + public String getZoneId() { + return zoneId; + } + + public SaveScheduleRequest setZoneId(String zoneId) { + this.zoneId = zoneId; + return this; + } @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/src/main/java/io/orkes/conductor/client/model/WorkflowSchedule.java b/src/main/java/io/orkes/conductor/client/model/WorkflowSchedule.java index 83633ddb..88983013 100644 --- a/src/main/java/io/orkes/conductor/client/model/WorkflowSchedule.java +++ b/src/main/java/io/orkes/conductor/client/model/WorkflowSchedule.java @@ -54,6 +54,9 @@ public class WorkflowSchedule { @SerializedName("updatedTime") private Long updatedTime = null; + @SerializedName("zoneId") // This is just a leftover having used GSON. + private String zoneId; + public WorkflowSchedule createTime(Long createTime) { this.createTime = createTime; return this; @@ -263,6 +266,15 @@ public void setUpdatedTime(Long updatedTime) { this.updatedTime = updatedTime; } + public String getZoneId() { + return zoneId; + } + + public WorkflowSchedule setZoneId(String zoneId) { + this.zoneId = zoneId; + return this; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { diff --git a/src/test/java/io/orkes/conductor/client/api/SchedulerClientTests.java b/src/test/java/io/orkes/conductor/client/api/SchedulerClientTests.java index 5fdb845a..6bce33f6 100644 --- a/src/test/java/io/orkes/conductor/client/api/SchedulerClientTests.java +++ b/src/test/java/io/orkes/conductor/client/api/SchedulerClientTests.java @@ -14,6 +14,10 @@ import java.util.List; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import io.orkes.conductor.client.SchedulerClient; @@ -34,9 +38,18 @@ public SchedulerClientTests() { schedulerClient = orkesClients.getSchedulerClient(); } + @BeforeEach + void beforeEach() { + schedulerClient.deleteSchedule(NAME); + } + + @AfterEach + void afterEach() { + schedulerClient.deleteSchedule(NAME); + } + @Test void testMethods() { - schedulerClient.deleteSchedule(NAME); assertTrue(schedulerClient.getNextFewSchedules(CRON_EXPRESSION, 0L, 0L, 0).isEmpty()); schedulerClient.saveSchedule(getSaveScheduleRequest()); assertTrue(schedulerClient.getAllSchedules(Commons.WORKFLOW_NAME).size() > 0); @@ -54,7 +67,6 @@ void testMethods() { schedulerClient.resumeSchedule(NAME); workflowSchedule = schedulerClient.getSchedule(NAME); assertFalse(workflowSchedule.isPaused()); - schedulerClient.deleteSchedule(NAME); } @Test @@ -64,6 +76,19 @@ void testDebugMethods() { schedulerClient.requeueAllExecutionRecords(); } + @Test + @DisplayName("It should set the timezone to Europe/Madrid") + void testTimeZoneId() { + var schedule = new SaveScheduleRequest() + .name(NAME) + .cronExpression(CRON_EXPRESSION) + .startWorkflowRequest(Commons.getStartWorkflowRequest()) + .setZoneId("Europe/Madrid"); + schedulerClient.saveSchedule(schedule); + var savedSchedule = schedulerClient.getSchedule(NAME); + assertEquals("Europe/Madrid", savedSchedule.getZoneId()); + } + SaveScheduleRequest getSaveScheduleRequest() { return new SaveScheduleRequest() .name(NAME) From 90caa4155aba9bf949eef12a710c5fa7f71f7133 Mon Sep 17 00:00:00 2001 From: Miguel Prieto Date: Thu, 8 Aug 2024 09:37:05 -0400 Subject: [PATCH 2/2] Added publish junit reports step to CI build --- .github/workflows/intgtest.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/intgtest.yml b/.github/workflows/intgtest.yml index d46c68ae..326a22c0 100644 --- a/.github/workflows/intgtest.yml +++ b/.github/workflows/intgtest.yml @@ -36,3 +36,8 @@ jobs: USER2_APPLICATION_ID: ${{ secrets.USER2_APPLICATION_ID }} USER2_KEY_ID: ${{ secrets.USER2_KEY_ID }} USER2_SECRET: ${{ secrets.USER2_SECRET }} + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: '**/build/test-results/test/TEST-*.xml'