fix failing test cases

This commit is contained in:
Vishwas Babu A J
2015-03-28 00:09:40 +05:30
parent 064fb4845c
commit 3043d2ae99
2 changed files with 19 additions and 17 deletions
@@ -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 {
@@ -47,9 +48,10 @@ public class WorkingDaysTest {
@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"));
} }
} }
@@ -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);