ptuomola commented on a change in pull request #817:
URL: https://github.com/apache/fineract/pull/817#discussion_r429027705



##########
File path: 
fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java
##########
@@ -122,45 +139,112 @@ private static String runSchedulerJobAsJSON() {
         return runSchedulerJob;
     }
 
-    public void executeJob(String jobName) throws InterruptedException {
-        List<Map> allSchedulerJobsData = getAllSchedulerJobs();
-        Assert.assertNotNull(allSchedulerJobsData);
-
+    private int getSchedulerJobIdByName(String jobName) {
+        List<Map<String, Object>> allSchedulerJobsData = getAllSchedulerJobs();
         for (Integer jobIndex = 0; jobIndex < allSchedulerJobsData.size(); 
jobIndex++) {
             if 
(allSchedulerJobsData.get(jobIndex).get("displayName").equals(jobName)) {
-                Integer jobId = (Integer) 
allSchedulerJobsData.get(jobIndex).get("jobId");
+                return (Integer) 
allSchedulerJobsData.get(jobIndex).get("jobId");
+            }
+        }
+        throw new IllegalArgumentException("No such named Job (see 
org.apache.fineract.infrastructure.jobs.service.JobName enum):" + jobName);
+    }
 
-                // Executing Scheduler Job
-                runSchedulerJob(this.requestSpec, jobId.toString());
+    @Deprecated // FINERACT-922 TODO Gradually replace use of this method with 
new executeAndAwaitJob() below, if it proves to be more stable than this one

Review comment:
       Sounds good - OK to resolve.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to