bumping up sql patch number
This commit is contained in:
+23
-21
@@ -8,6 +8,7 @@ package org.mifosplatform.integrationtests.common;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.mifosplatform.integrationtests.common.system.CodeHelper;
|
import org.mifosplatform.integrationtests.common.system.CodeHelper;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@@ -54,15 +55,16 @@ public class ClientHelper {
|
|||||||
"clientId");
|
"clientId");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Integer createClientForAccountPreference(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
public static Integer createClientForAccountPreference(final RequestSpecification requestSpec,
|
||||||
final Integer clientType,String jsonAttributeToGetBack) {
|
final ResponseSpecification responseSpec, final Integer clientType, String jsonAttributeToGetBack) {
|
||||||
final String activationDate = "04 March 2011";
|
final String activationDate = "04 March 2011";
|
||||||
final String officeId = "1";
|
final String officeId = "1";
|
||||||
System.out.println("---------------------------------CREATING A CLIENT BASED ON ACCOUNT PREFERENCE---------------------------------------------");
|
System.out
|
||||||
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL, getTestClientWithClientTypeAsJSON(activationDate, officeId, clientType.toString()),
|
.println("---------------------------------CREATING A CLIENT BASED ON ACCOUNT PREFERENCE---------------------------------------------");
|
||||||
jsonAttributeToGetBack);
|
return Utils.performServerPost(requestSpec, responseSpec, CREATE_CLIENT_URL,
|
||||||
|
getTestClientWithClientTypeAsJSON(activationDate, officeId, clientType.toString()), jsonAttributeToGetBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object assignStaffToClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
public static Object assignStaffToClient(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||||
final String clientId, final String staffId) {
|
final String clientId, final String staffId) {
|
||||||
final String CLIENT_ASSIGN_STAFF_URL = "/mifosng-provider/api/v1/clients/" + clientId + "?" + Utils.TENANT_IDENTIFIER
|
final String CLIENT_ASSIGN_STAFF_URL = "/mifosng-provider/api/v1/clients/" + clientId + "?" + Utils.TENANT_IDENTIFIER
|
||||||
@@ -90,9 +92,8 @@ public class ClientHelper {
|
|||||||
System.out.println("map : " + map);
|
System.out.println("map : " + map);
|
||||||
return new Gson().toJson(map);
|
return new Gson().toJson(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getTestClientWithClientTypeAsJSON(final String dateOfJoining, final String officeId,
|
public static String getTestClientWithClientTypeAsJSON(final String dateOfJoining, final String officeId, final String clientType) {
|
||||||
final String clientType) {
|
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
final HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("officeId", officeId);
|
map.put("officeId", officeId);
|
||||||
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
|
map.put("firstname", Utils.randomNameGenerator("Client_FirstName_", 5));
|
||||||
@@ -130,9 +131,10 @@ public class ClientHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HashMap getClientStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
@SuppressWarnings("unchecked")
|
||||||
|
public static HashMap<String, Object> getClientStatus(final RequestSpecification requestSpec, final ResponseSpecification responseSpec,
|
||||||
final String clientId) {
|
final String clientId) {
|
||||||
return (HashMap) getClient(requestSpec, responseSpec, clientId, "status");
|
return (HashMap<String, Object>) getClient(requestSpec, responseSpec, clientId, "status");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String randomIDGenerator(final String prefix, final int lenOfRandomSuffix) {
|
private static String randomIDGenerator(final String prefix, final int lenOfRandomSuffix) {
|
||||||
@@ -141,21 +143,21 @@ public class ClientHelper {
|
|||||||
|
|
||||||
private String getCloseClientAsJSON() {
|
private String getCloseClientAsJSON() {
|
||||||
final HashMap<String, String> map = new HashMap<>();
|
final HashMap<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
/* Retrieve Code id for the Code "ClientClosureReason" */
|
/* Retrieve Code id for the Code "ClientClosureReason" */
|
||||||
String codeName = "ClientClosureReason";
|
String codeName = "ClientClosureReason";
|
||||||
HashMap<String,Object> code = CodeHelper.getCodeByName(this.requestSpec, this.responseSpec, codeName);
|
HashMap<String, Object> code = CodeHelper.getCodeByName(this.requestSpec, this.responseSpec, codeName);
|
||||||
Integer clientClosureCodeId = (Integer)code.get("id");
|
Integer clientClosureCodeId = (Integer) code.get("id");
|
||||||
|
|
||||||
/* Retrieve/Create Code Values for the Code "ClientClosureReason" */
|
/* Retrieve/Create Code Values for the Code "ClientClosureReason" */
|
||||||
HashMap<String,Object> codeValue = CodeHelper.retrieveOrCreateCodeValue(clientClosureCodeId,this.requestSpec,this.responseSpec);
|
HashMap<String, Object> codeValue = CodeHelper.retrieveOrCreateCodeValue(clientClosureCodeId, this.requestSpec, this.responseSpec);
|
||||||
String closureReasonId = (String)codeValue.get("id");
|
String closureReasonId = (String) codeValue.get("id");
|
||||||
|
|
||||||
map.put("closureReasonId", closureReasonId);
|
map.put("closureReasonId", closureReasonId);
|
||||||
map.put("locale", CommonConstants.locale);
|
map.put("locale", CommonConstants.locale);
|
||||||
map.put("dateFormat", CommonConstants.dateFormat);
|
map.put("dateFormat", CommonConstants.dateFormat);
|
||||||
map.put("closureDate", CREATED_DATE_PLUS_ONE);
|
map.put("closureDate", CREATED_DATE_PLUS_ONE);
|
||||||
|
|
||||||
String clientJson = new Gson().toJson(map);
|
String clientJson = new Gson().toJson(map);
|
||||||
System.out.println(clientJson);
|
System.out.println(clientJson);
|
||||||
return clientJson;
|
return clientJson;
|
||||||
|
|||||||
Reference in New Issue
Block a user