Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FINERACT-2165: Mark all the RestAssured solutions as deprecated in the integration tests module #4247

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public static ApiParameterError updateBusinessStepOrderWithError(final RequestSpecification requestSpec,
final ResponseSpecification responseSpec, String jobName, String jsonBodyToSend) {
String response = Utils.performServerPut(requestSpec, responseSpec,
Expand Down
Loading
Loading