From 7a98ad8d07ae1ff8b3c88722e1bf51a2b3adb1a3 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 5 May 2020 11:37:31 +0200 Subject: [PATCH] add new testNumberOfJobs() to SchedulerJobsTest (re. FINERACT-922) This would catch problems such as the integration tests running "too early" (before Flyway has fully initialized the database), which I have a suspicion could be one of (many) causes of the unstable scheduler tests, notably because of the IllegalArgumentException at SchedulerJobsTest.java:90 in https://github.com/apache/fineract/pull/817 --- .../apache/fineract/integrationtests/SchedulerJobsTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java index 21181521e..f256047e5 100644 --- a/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java +++ b/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/SchedulerJobsTest.java @@ -97,6 +97,12 @@ public class SchedulerJobsTest { } } + @Test + public void testNumberOfJobs() { + List jobIds = schedulerJobHelper.getAllSchedulerJobIds(); + assertEquals("Number of jobs in database and code do not match: " + jobIds, JobName.values().length, jobIds.size()); + } + @Test public void testFlippingJobsActiveStatus() throws InterruptedException { // Stop the Scheduler while we test flapping jobs' active on/off, to avoid side