Search in sources :

Example 61 with ObjectMapper

use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.

the class RESTAPITest method savingsDueByGlobalNum.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void savingsDueByGlobalNum() throws Exception {
    String type = Type.SAVINGS;
    String by = By.GLOBAL_NUMBER;
    String value = SAVINGS_MANDATORY_ACCOUNT_GLOBAL_ID + Op.DUE;
    String actualJSON = helper.getJSONFromUI(type, by, value);
    String expectedJSON = helper.getJSONFromDataSet(type, by, value);
    ObjectMapper mapper = helper.getObjectMapper();
    Assert.assertEquals(mapper.readTree(expectedJSON), mapper.readTree(actualJSON));
}
Also used : ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Test(org.testng.annotations.Test)

Example 62 with ObjectMapper

use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.

the class RESTAPITest method paymentTypesByAcceptedState.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void paymentTypesByAcceptedState() throws Exception {
    String type = Type.PAYMENT_TYPES;
    String by = By.STATE;
    String value = PAYMENT_TYPES_ACCEPTED;
    String actualJSON = helper.getJSONFromUI(type, by, value);
    String expectedJSON = helper.getJSONFromDataSet(type, by, value);
    ObjectMapper mapper = helper.getObjectMapper();
    Assert.assertEquals(mapper.readTree(expectedJSON), mapper.readTree(actualJSON));
}
Also used : ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Test(org.testng.annotations.Test)

Example 63 with ObjectMapper

use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.

the class RESTAPITest method officeById.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void officeById() throws Exception {
    String type = Type.OFFICE;
    String by = By.ID;
    String value = OFFICE_ID;
    String actualJSON = helper.getJSONFromUI(type, by, value);
    String expectedJSON = helper.getJSONFromDataSet(type, by, value);
    ObjectMapper mapper = helper.getObjectMapper();
    Assert.assertEquals(mapper.readTree(expectedJSON), mapper.readTree(actualJSON));
}
Also used : ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Test(org.testng.annotations.Test)

Example 64 with ObjectMapper

use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.

the class RESTAPITest method clientByGlobalNum.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void clientByGlobalNum() throws Exception {
    String type = Type.CLIENT;
    String by = By.GLOBAL_NUMBER;
    String value = CLIENT_GLOBAL_ID;
    String actualJSON = helper.getJSONFromUI(type, by, value);
    String expectedJSON = helper.getJSONFromDataSet(type, by, value);
    ObjectMapper mapper = helper.getObjectMapper();
    Assert.assertEquals(mapper.readTree(expectedJSON), mapper.readTree(actualJSON));
}
Also used : ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Test(org.testng.annotations.Test)

Example 65 with ObjectMapper

use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.

the class RESTAPITest method clientChargesByGlobalNum.

@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void clientChargesByGlobalNum() throws Exception {
    String type = Type.CLIENT;
    String by = By.GLOBAL_NUMBER;
    String value = CLIENT_GLOBAL_ID + Op.CHARGES;
    String actualJSON = helper.getJSONFromUI(type, by, value);
    String expectedJSON = helper.getJSONFromDataSet(type, by, value);
    ObjectMapper mapper = helper.getObjectMapper();
    Assert.assertEquals(mapper.readTree(expectedJSON), mapper.readTree(actualJSON));
}
Also used : ObjectMapper(org.codehaus.jackson.map.ObjectMapper) Test(org.testng.annotations.Test)

Aggregations

ObjectMapper (org.codehaus.jackson.map.ObjectMapper)386 IOException (java.io.IOException)85 Test (org.junit.Test)61 JsonNode (org.codehaus.jackson.JsonNode)50 HashMap (java.util.HashMap)46 ArrayList (java.util.ArrayList)45 Test (org.testng.annotations.Test)37 Map (java.util.Map)34 List (java.util.List)26 File (java.io.File)22 StringWriter (java.io.StringWriter)22 JSONObject (org.json.JSONObject)18 SimpleModule (org.codehaus.jackson.map.module.SimpleModule)17 JsonMappingException (org.codehaus.jackson.map.JsonMappingException)16 ByteArrayInputStream (java.io.ByteArrayInputStream)14 Version (org.codehaus.jackson.Version)14 JsonFactory (org.codehaus.jackson.JsonFactory)13 JSONObject (org.codehaus.jettison.json.JSONObject)13 ByteArrayOutputStream (java.io.ByteArrayOutputStream)11 JsonGenerator (org.codehaus.jackson.JsonGenerator)11