Skip to content

Commit

Permalink
FINERACT-2165: Mark all the RestAssured solutions as deprecated in th…
Browse files Browse the repository at this point in the history
…e integration tests module
  • Loading branch information
adamsaghy committed Jan 22, 2025
1 parent 6348140 commit a9d76ef
Show file tree
Hide file tree
Showing 78 changed files with 4,398 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,40 @@ public class AuditHelper {
private ResponseSpecification responseSpec;
private RequestSpecification requestSpec;

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public AuditHelper(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) {
this.requestSpec = requestSpec;
this.responseSpec = responseSpec;
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public List getAuditDetails(final Integer resourceId, final String actionName, final String entityName) {
final String AUDIT_URL = AUDIT_BASE_URL + "&entityName=" + entityName + "&resourceId=" + resourceId + "&actionName=" + actionName
+ "&orderBy=id&sortBy=DSC";
List<HashMap<String, Object>> responseAudits = Utils.performServerGet(requestSpec, responseSpec, AUDIT_URL, "");
return responseAudits;
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public List getAuditDetails(final int limit) {
final String AUDIT_URL = AUDIT_BASE_URL + "&paged=true&limit=" + Integer.toString(limit);
LinkedHashMap responseAudits = Utils.performServerGet(requestSpec, responseSpec, AUDIT_URL, "");
return (List) responseAudits.get("pageItems");
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public LinkedHashMap getAuditSearchTemplate() {
return Utils.performServerGet(requestSpec, responseSpec, AUDITSEARCH_BASE_URL, "$");
}
Expand All @@ -75,6 +91,10 @@ public LinkedHashMap getAuditSearchTemplate() {
* Some audit actions can only be done once Eg: Creation of a client with id 123, hence we verify number of audits
* For such operations is "equal" to 1 always
*/
// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public void verifyOneAuditOnly(List<HashMap<String, Object>> auditsToCheck, Integer id, String actionName, String entityType) {
LOG.info("------------------------------CHECK IF AUDIT CREATED------------------------------------\n");
assertEquals(1, auditsToCheck.size(), "More than one audit created");
Expand All @@ -85,6 +105,10 @@ public void verifyOneAuditOnly(List<HashMap<String, Object>> auditsToCheck, Inte
assertEquals(expected, actual, "Error in creating audit!");
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public void verifyMultipleAuditsOnserver(List<HashMap<String, Object>> auditsRecievedInitial,
List<HashMap<String, Object>> auditsRecieved, Integer id, String actionName, String entityType) {
LOG.info("------------------------------CHECK IF AUDIT CREATED------------------------------------\n");
Expand All @@ -102,10 +126,18 @@ public void verifyMultipleAuditsOnserver(List<HashMap<String, Object>> auditsRec
assertEquals(expected, actual, "Error in creating audit!");
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public void verifyLimitParameterfor(final int limit) {
assertEquals(limit, getAuditDetails(limit).size(), "Incorrect number of audits recieved for limit: " + Integer.toString(limit));
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public void verifyOrderBysupported(final String orderByValue) {
final String AUDIT_URL = AUDIT_BASE_URL + "&paged=true&orderBy=" + orderByValue;
Utils.performServerGet(requestSpec, responseSpec, AUDIT_URL, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ private BatchHelper() {
* @param batchRequests
* @return JSON String of BatchRequest
*/
// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static String toJsonString(final List<BatchRequest> batchRequests) {
return new Gson().toJson(batchRequests);
}
Expand All @@ -81,6 +85,10 @@ public static String toJsonString(final List<BatchRequest> batchRequests) {
* @param
* @return Map
*/
// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static Map generateMapFromJsonString(final String jsonString) {
return new Gson().fromJson(jsonString, Map.class);
}
Expand All @@ -91,6 +99,10 @@ public static Map generateMapFromJsonString(final String jsonString) {
* @param json
* @return {@code List<BatchResponse>}
*/
// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
private static List<BatchResponse> fromJsonString(final String json) {
return new Gson().fromJson(json, new TypeToken<List<BatchResponse>>() {}.getType());
}
Expand All @@ -104,6 +116,10 @@ private static List<BatchResponse> fromJsonString(final String json) {
* @param jsonifiedBatchRequests
* @return a list of BatchResponse
*/
// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static List<BatchResponse> postBatchRequestsWithoutEnclosingTransaction(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String jsonifiedBatchRequests) {
final String response = Utils.performServerPost(requestSpec, responseSpec, BATCH_API_WITHOUT_ENCLOSING_URL_EXT,
Expand All @@ -112,6 +128,10 @@ public static List<BatchResponse> postBatchRequestsWithoutEnclosingTransaction(f
return BatchHelper.fromJsonString(response);
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static ErrorResponse postBatchRequestsWithoutEnclosingTransactionError(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String jsonifiedBatchRequests) {
final String response = Utils.performServerPost(requestSpec, responseSpec, BATCH_API_WITHOUT_ENCLOSING_URL_EXT,
Expand All @@ -129,6 +149,10 @@ public static ErrorResponse postBatchRequestsWithoutEnclosingTransactionError(fi
* @param jsonifiedBatchRequests
* @return a list of BatchResponse
*/
// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static List<BatchResponse> postBatchRequestsWithEnclosingTransaction(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final String jsonifiedBatchRequests) {
final String response = Utils.performServerPost(requestSpec, responseSpec, BATCH_API_URL_EXT, jsonifiedBatchRequests, null);
Expand All @@ -141,6 +165,10 @@ public static List<BatchResponse> postBatchRequestsWithEnclosingTransaction(fina
* @param
* @return {@code List<BatchResponse>}
*/
// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static List<BatchResponse> postWithSingleRequest(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, final BatchRequest br) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public final class BusinessDateHelper extends IntegrationTest {

public BusinessDateHelper() {}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static HashMap updateBusinessDate(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final BusinessDateType type, final LocalDate date) {
final String BUSINESS_DATE_API = "/fineract-provider/api/v1/businessdate?" + Utils.TENANT_IDENTIFIER;
Expand All @@ -52,6 +56,10 @@ public BusinessDateResponse updateBusinessDate(final BusinessDateRequest request
return ok(fineract().businessDateManagement.updateBusinessDate(request));
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public BusinessDateResponse getBusinessDateByType(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
final BusinessDateType type) {
final String BUSINESS_DATE_API = "/fineract-provider/api/v1/businessdate/" + type.name() + "?" + Utils.TENANT_IDENTIFIER;
Expand All @@ -68,6 +76,10 @@ public List<BusinessDateResponse> getBusinessDates() {
return ok(fineract().businessDateManagement.getBusinessDates());
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
private static String buildBusinessDateRequest(BusinessDateType type, LocalDate date) {
final HashMap<String, String> map = new HashMap<>();
map.put("type", type.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,42 @@ private BusinessStepConfigurationHelper() {

}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static String toJsonString(final List<BusinessStep> batchRequests) {
return new Gson().toJson(new BusinessStepWrapper(batchRequests));
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
private static JobBusinessStepConfigData configuredBusinessStepFromJsonString(final String json) {
return new Gson().fromJson(json, new TypeToken<JobBusinessStepConfigData>() {}.getType());
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
private static ApiParameterError configuredApiParameterErrorFromJsonString(final String json) {
return new Gson().fromJson(json, new TypeToken<ApiParameterError>() {}.getType());
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
private static JobBusinessStepDetail availableBusinessStepFromJsonString(final String json) {
return new Gson().fromJson(json, new TypeToken<JobBusinessStepDetail>() {}.getType());
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static JobBusinessStepConfigData getConfiguredBusinessStepsByJobName(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, String jobName) {
final String response = Utils.performServerGet(requestSpec, responseSpec,
Expand All @@ -64,6 +84,10 @@ public static JobBusinessStepConfigData getConfiguredBusinessStepsByJobName(fina
return BusinessStepConfigurationHelper.configuredBusinessStepFromJsonString(response);
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static JobBusinessStepDetail getAvailableBusinessStepsByJobName(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, String jobName) {
final String response = Utils.performServerGet(requestSpec, responseSpec,
Expand All @@ -72,13 +96,21 @@ public static JobBusinessStepDetail getAvailableBusinessStepsByJobName(final Req
return BusinessStepConfigurationHelper.availableBusinessStepFromJsonString(response);
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static void updateBusinessStepOrder(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
String jobName, String jsonBodyToSend) {
String response = Utils.performServerPut(requestSpec, responseSpec,
BUSINESS_STEPS_API_URL_START + jobName + BUSINESS_STEPS_API_URL_END, jsonBodyToSend);
log.info("BusinessStepConfigurationHelper Response: {}", response);
}

// TODO: Rewrite to use fineract-client instead!
// Example: org.apache.fineract.integrationtests.common.loans.LoanTransactionHelper.disburseLoan(java.lang.Long,
// org.apache.fineract.client.models.PostLoansLoanIdRequest)
@Deprecated(forRemoval = true)
public static ApiParameterError updateBusinessStepOrderWithError(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, String jobName, String jsonBodyToSend) {
String response = Utils.performServerPut(requestSpec, responseSpec,
Expand Down
Loading

0 comments on commit a9d76ef

Please sign in to comment.