ptuomola commented on a change in pull request #817:
URL: https://github.com/apache/fineract/pull/817#discussion_r429027848
##########
File path:
fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/common/SchedulerJobHelper.java
##########
@@ -51,21 +60,28 @@ public SchedulerJobHelper(final RequestSpecification
requestSpec, final Response
this.response202Spec = responseSpec;
}
- private List getAllSchedulerJobs() {
+ private List<Map<String, Object>> getAllSchedulerJobs() {
final String GET_ALL_SCHEDULER_JOBS_URL =
"/fineract-provider/api/v1/jobs?" + Utils.TENANT_IDENTIFIER;
System.out.println("------------------------ RETRIEVING ALL SCHEDULER
JOBS -------------------------");
- final ArrayList response = Utils.performServerGet(requestSpec,
response200Spec, GET_ALL_SCHEDULER_JOBS_URL, "");
+ List<Map<String, Object>> response =
Utils.performServerGet(requestSpec, response200Spec,
GET_ALL_SCHEDULER_JOBS_URL, "");
+ assertNotNull(response);
return response;
}
+ private <T> List<T> getAllSchedulerJobDetails(Function<Map<String,
Object>, T> mapper) {
+ return
getAllSchedulerJobs().stream().map(mapper).collect(Collectors.toList());
+ }
+
public List<Integer> getAllSchedulerJobIds() {
- ToIntFunction<Map> mapper = map -> (Integer) map.get("jobId");
- return
getAllSchedulerJobs().stream().mapToInt(mapper).boxed().collect(Collectors.toList());
+ return getAllSchedulerJobDetails(map -> (Integer) map.get("jobId"));
+ }
+
+ public List<String> getAllSchedulerJobNames() {
+ return getAllSchedulerJobDetails(map -> (String)
map.get("displayName"));
}
public Map<String, Object> getSchedulerJobById(int jobId) {
final String GET_SCHEDULER_JOB_BY_ID_URL =
"/fineract-provider/api/v1/jobs/" + jobId + "?" + Utils.TENANT_IDENTIFIER;
- System.out.println("------------------------ RETRIEVING SCHEDULER JOB
BY ID -------------------------");
Review comment:
Yep - 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]