From a5a4d1670d1359d0b1585532d4e06b37bc0d4f88 Mon Sep 17 00:00:00 2001 From: Vishwas Babu A J Date: Tue, 7 Apr 2015 10:33:30 -0700 Subject: [PATCH] fixing failing test cases on payment types --- .../integrationtests/PaymentTypeIntegrationTest.java | 2 +- .../integrationtests/common/PaymentTypeHelper.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/PaymentTypeIntegrationTest.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/PaymentTypeIntegrationTest.java index 1010ced34..639ae61c3 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/PaymentTypeIntegrationTest.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/PaymentTypeIntegrationTest.java @@ -72,7 +72,7 @@ public class PaymentTypeIntegrationTest { // Delete Integer deletedPaymentTypeId = PaymentTypeHelper.deletePaymentType(paymentTypeId, requestSpec, responseSpec); Assert.assertEquals(paymentTypeId, deletedPaymentTypeId); - ResponseSpecification responseSpecification = new ResponseSpecBuilder().expectStatusCode(403).build(); + ResponseSpecification responseSpecification = new ResponseSpecBuilder().expectStatusCode(404).build(); PaymentTypeHelper.retrieveById(requestSpec, responseSpecification, paymentTypeId); } diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/PaymentTypeHelper.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/PaymentTypeHelper.java index 5fa626288..85c72db11 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/PaymentTypeHelper.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/PaymentTypeHelper.java @@ -17,8 +17,8 @@ import com.jayway.restassured.specification.ResponseSpecification; @SuppressWarnings({ "rawtypes", "unchecked" }) public class PaymentTypeHelper { - private static final String CREATE_PAYMENTTYPE_URL = "/mifosng-provider/api/v1/paymenttype?" + Utils.TENANT_IDENTIFIER; - private static final String PAYMENTTYPE_URL = "/mifosng-provider/api/v1/paymenttype"; + private static final String CREATE_PAYMENTTYPE_URL = "/mifosng-provider/api/v1/paymenttypes?" + Utils.TENANT_IDENTIFIER; + private static final String PAYMENTTYPE_URL = "/mifosng-provider/api/v1/paymenttypes"; public static Integer createPaymentType(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final String name, final String description, final Boolean isCashPayment, final Integer position) { @@ -42,14 +42,14 @@ public class PaymentTypeHelper { public static void verifyPaymentTypeCreatedOnServer(final RequestSpecification requestSpec, final ResponseSpecification responseSpec, final Integer generatedPaymentTypeID) { System.out.println("------------------------------CHECK PAYMENT DETAILS------------------------------------\n"); - final String PAYMENTTYPE_URL = "/mifosng-provider/api/v1/paymenttype/" + generatedPaymentTypeID + "?" + Utils.TENANT_IDENTIFIER; - final Integer responsePaymentTypeID = Utils.performServerGet(requestSpec, responseSpec, PAYMENTTYPE_URL, "id"); + final String GET_PAYMENTTYPE_URL = PAYMENTTYPE_URL + "/" + generatedPaymentTypeID + "?" + Utils.TENANT_IDENTIFIER; + final Integer responsePaymentTypeID = Utils.performServerGet(requestSpec, responseSpec, GET_PAYMENTTYPE_URL, "id"); assertEquals("ERROR IN CREATING THE PAYMENT TYPE", generatedPaymentTypeID, responsePaymentTypeID); } public static PaymentTypeDomain retrieveById(RequestSpecification requestSpec, ResponseSpecification responseSpec, final Integer paymentTypeId) { - final String GET_PAYMENTTYPE_URL = "/mifosng-provider/api/v1/paymenttype/" + paymentTypeId + "?" + Utils.TENANT_IDENTIFIER; + final String GET_PAYMENTTYPE_URL = PAYMENTTYPE_URL + "/" + paymentTypeId + "?" + Utils.TENANT_IDENTIFIER; System.out.println("---------------------------------GET PAYMENT TYPE---------------------------------------------"); final String jsonData = new Gson().toJson(Utils.performServerGet(requestSpec, responseSpec, GET_PAYMENTTYPE_URL, "")); return new Gson().fromJson(jsonData, new TypeToken() {}.getType());