use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.
the class RESTAPITest method centerChargesByGlobalNum.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void centerChargesByGlobalNum() throws Exception {
String type = Type.CENTER;
String by = By.GLOBAL_NUMBER;
String value = CENTER_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));
}
use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.
the class RESTAPITest method groupByGlobalNum.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void groupByGlobalNum() throws Exception {
String type = Type.GROUP;
String by = By.GLOBAL_NUMBER;
String value = GROUP_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));
}
use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.
the class RESTAPITest method loanRepaymentScheduleByGlobalNum.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void loanRepaymentScheduleByGlobalNum() throws Exception {
String type = Type.LOAN;
String by = By.GLOBAL_NUMBER;
String value = LOAN_ACCOUNT_GLOBAL_ID + Op.SCHEDULE;
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));
}
use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.
the class RESTAPITest method applicableFeesForClientByGlobalNum.
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test(groups = "readOnly")
public void applicableFeesForClientByGlobalNum() throws Exception {
String type = Type.CUSTOMER;
String by = By.GLOBAL_NUMBER;
String value = CLIENT_GLOBAL_ID + Op.APPLICABLE_FEES;
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));
}
use of org.codehaus.jackson.map.ObjectMapper in project head by mifos.
the class RESTAPITestHelper method getObjectMapper.
public ObjectMapper getObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY, true);
mapper.configure(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS, true);
mapper.configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, false);
mapper.configure(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS, true);
return mapper;
}
Aggregations