FINERACT-1503:FixStaffModule

This commit is contained in:
rrpawar96
2022-02-20 20:00:25 +01:00
committed by Aleksandar Vidakovic
parent 45bed0a05a
commit 72fd2fe134
3 changed files with 25 additions and 1 deletions
@@ -236,7 +236,7 @@ public class StaffReadPlatformServiceImpl implements StaffReadPlatformService {
extraCriteria.addNonNullCriteria(" s.office_id = ", officeId);
if (loanOfficersOnly) {
extraCriteria.addCriteria(" s.is_loan_officer is ", " true ");
extraCriteria.addCriteria(" s.is_loan_officer = ", true);
}
// Passing status parameter to get ACTIVE (By Default), INACTIVE or ALL
// (Both active and Inactive) employees
@@ -241,4 +241,22 @@ public class StaffTest {
map.put("xyz", "xyz");
StaffHelper.updateStaff(requestSpec, responseSpecForValidationError, 1, map);
}
@Test
public void testStaffLoanOfficer() {
final Map<String, Object> map = StaffHelper.getMapWithJoiningDate();
map.put("officeId", 1);
map.put("firstname", Utils.randomNameGenerator("michael_", 5));
map.put("lastname", Utils.randomNameGenerator("Doe_", 5));
map.put("isLoanOfficer", true);
StaffHelper.createStaffWithJson(requestSpec, responseSpec, new Gson().toJson(map));
List<Map<String, Object>> responseActive = StaffHelper.getStaffListWithLoanOfficerStatus(requestSpec, responseSpec, "true");
for (final Map<String, Object> staff : responseActive) {
Assertions.assertNotNull(staff.get("id"));
Assertions.assertEquals(true, staff.get("isLoanOfficer"));
}
}
}
@@ -87,6 +87,12 @@ public final class StaffHelper {
return Utils.performServerGet(requestSpec, responseSpec, url, "");
}
public static List<Map<String, Object>> getStaffListWithLoanOfficerStatus(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String loanOfficerStatus) {
final String url = CREATE_STAFF_URL + "?" + Utils.TENANT_IDENTIFIER + "&loanOfficersOnly=" + loanOfficerStatus;
return Utils.performServerGet(requestSpec, responseSpec, url, "");
}
public static Map<String, Object> updateStaff(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final Integer staffId, final Map<String, Object> changes) {
final String url = CREATE_STAFF_URL + "/" + staffId + "?" + Utils.TENANT_IDENTIFIER;