fix failing test cases
This commit is contained in:
+18
-16
@@ -5,11 +5,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.mifosplatform.integrationtests;
|
package org.mifosplatform.integrationtests;
|
||||||
|
|
||||||
import com.jayway.restassured.builder.RequestSpecBuilder;
|
import static org.junit.Assert.assertEquals;
|
||||||
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
|
||||||
import com.jayway.restassured.http.ContentType;
|
import java.util.HashMap;
|
||||||
import com.jayway.restassured.specification.RequestSpecification;
|
import java.util.List;
|
||||||
import com.jayway.restassured.specification.ResponseSpecification;
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -17,10 +17,11 @@ import org.mifosplatform.integrationtests.common.CommonConstants;
|
|||||||
import org.mifosplatform.integrationtests.common.Utils;
|
import org.mifosplatform.integrationtests.common.Utils;
|
||||||
import org.mifosplatform.integrationtests.common.WorkingDaysHelper;
|
import org.mifosplatform.integrationtests.common.WorkingDaysHelper;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import com.jayway.restassured.builder.RequestSpecBuilder;
|
||||||
import java.util.List;
|
import com.jayway.restassured.builder.ResponseSpecBuilder;
|
||||||
|
import com.jayway.restassured.http.ContentType;
|
||||||
import static org.junit.Assert.assertEquals;
|
import com.jayway.restassured.specification.RequestSpecification;
|
||||||
|
import com.jayway.restassured.specification.ResponseSpecification;
|
||||||
|
|
||||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
public class WorkingDaysTest {
|
public class WorkingDaysTest {
|
||||||
@@ -30,7 +31,7 @@ public class WorkingDaysTest {
|
|||||||
private ResponseSpecification generalResponseSpec;
|
private ResponseSpecification generalResponseSpec;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp(){
|
public void setUp() {
|
||||||
Utils.initializeRESTAssured();
|
Utils.initializeRESTAssured();
|
||||||
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
this.requestSpec = new RequestSpecBuilder().setContentType(ContentType.JSON).build();
|
||||||
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
this.requestSpec.header("Authorization", "Basic " + Utils.loginIntoServerAndGetBase64EncodedAuthenticationKey());
|
||||||
@@ -40,16 +41,17 @@ public class WorkingDaysTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateWorkingDays(){
|
public void updateWorkingDays() {
|
||||||
HashMap response = (HashMap)WorkingDaysHelper.updateWorkingDays(requestSpec, responseSpec);
|
HashMap response = (HashMap) WorkingDaysHelper.updateWorkingDays(requestSpec, responseSpec);
|
||||||
Assert.assertNotNull(response.get("resourceId"));
|
Assert.assertNotNull(response.get("resourceId"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void updateWorkingDaysWithWrongRecurrencePattern(){
|
public void updateWorkingDaysWithWrongRecurrencePattern() {
|
||||||
final List<HashMap> error = (List) WorkingDaysHelper.updateWorkingDaysWithWrongRecurrence(requestSpec, generalResponseSpec, CommonConstants.RESPONSE_ERROR);
|
final List<HashMap> error = (List) WorkingDaysHelper.updateWorkingDaysWithWrongRecurrence(requestSpec, generalResponseSpec,
|
||||||
assertEquals("Verify wrong recurrence pattern error", "error.msg.recurring.rule.parsing.error", error.get(0).get("userMessageGlobalisationCode"));
|
CommonConstants.RESPONSE_ERROR);
|
||||||
|
assertEquals("Verify wrong recurrence pattern error", "error.msg.recurring.rule.parsing.error",
|
||||||
|
error.get(0).get("userMessageGlobalisationCode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ public class WorkingDaysHelper {
|
|||||||
|
|
||||||
public static String updateWorkingDaysAsJson() {
|
public static String updateWorkingDaysAsJson() {
|
||||||
final HashMap<String, Object> map = new HashMap<>();
|
final HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("recurrence", "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH");
|
map.put("recurrence", "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU");
|
||||||
map.put("locale", "en");
|
map.put("locale", "en");
|
||||||
map.put("repaymentRescheduleType", randomInt(1, 4));
|
map.put("repaymentRescheduleType", randomInt(1, 4));
|
||||||
System.out.println("map : " + map);
|
System.out.println("map : " + map);
|
||||||
|
|||||||
Reference in New Issue
Block a user