diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FundsIntegrationTest.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FundsIntegrationTest.java index 80a6e8887..abfb03179 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FundsIntegrationTest.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/FundsIntegrationTest.java @@ -8,7 +8,6 @@ package org.mifosplatform.integrationtests; import static org.hamcrest.Matchers.*; import static org.junit.Assert.assertEquals; -import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import org.junit.Assert; import org.junit.Before; @@ -69,13 +68,10 @@ public class FundsIntegrationTest { final Long fundID = createFund(jsonData, this.requestSpec, this.responseSpec); Assert.assertNotNull(fundID); - List> list = FundsResourceHandler.retrieveAllFunds(this.requestSpec, this.responseSpec); + List fhList = FundsResourceHandler.retrieveAllFunds(this.requestSpec, this.responseSpec); - Assert.assertNotNull(list); - Assert.assertThat(list.size(), greaterThanOrEqualTo(1)); - - jsonData = new Gson().toJson(list); - List fhList = new Gson().fromJson(jsonData, new TypeToken>(){}.getType()); + Assert.assertNotNull(fhList); + Assert.assertThat(fhList.size(), greaterThanOrEqualTo(1)); Assert.assertThat(fhList, hasItem(fh)); } diff --git a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/funds/FundsResourceHandler.java b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/funds/FundsResourceHandler.java index 70fdd4795..9e25df5b8 100644 --- a/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/funds/FundsResourceHandler.java +++ b/mifosng-provider/src/integrationTest/java/org/mifosplatform/integrationtests/common/funds/FundsResourceHandler.java @@ -5,6 +5,7 @@ */ package org.mifosplatform.integrationtests.common.funds; +import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import com.jayway.restassured.specification.RequestSpecification; import com.jayway.restassured.specification.ResponseSpecification; @@ -24,10 +25,12 @@ public class FundsResourceHandler { return Utils.performServerPost(requestSpec, responseSpec, CREATE_FUNDS_URL, fundJSON, "resourceId"); } - public static List> retrieveAllFunds(final RequestSpecification requestSpec, + public static List retrieveAllFunds(final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { final String URL = FUNDS_URL + "?" + Utils.TENANT_IDENTIFIER; - return Utils.performServerGet(requestSpec, responseSpec, URL, ""); + List> list = Utils.performServerGet(requestSpec, responseSpec, URL, ""); + String jsonData = new Gson().toJson(list); + return new Gson().fromJson(jsonData, new TypeToken>(){}.getType()); } public static String retrieveFund(final Long fundID,