use of com.linkedin.data.codec.JacksonDataCodec in project rest.li by linkedin.
the class TestData method testNonCyclicMapWithClone.
@Test
public void testNonCyclicMapWithClone() throws Exception {
DataMap root = new DataMap();
root.put("key", "a");
root.put("map", root.clone());
new JacksonDataCodec().mapToString(root);
}
use of com.linkedin.data.codec.JacksonDataCodec in project rest.li by linkedin.
the class TestData method testListCycleDetection.
@Test(expectedExceptions = IOException.class)
public void testListCycleDetection() throws Exception {
DataList root = new DataList();
root.getUnderlying().add(root);
new JacksonDataCodec().listToString(root);
}
use of com.linkedin.data.codec.JacksonDataCodec in project rest.li by linkedin.
the class TestData method testMapCycleDetection.
@Test(expectedExceptions = IOException.class)
public void testMapCycleDetection() throws Exception {
DataMap root = new DataMap();
root.getUnderlying().put("child", root);
new JacksonDataCodec().mapToString(root);
}
use of com.linkedin.data.codec.JacksonDataCodec in project rest.li by linkedin.
the class TestData method testNonCyclicListWithClone.
@Test
public void testNonCyclicListWithClone() throws Exception {
DataList list = new DataList();
list.add("a");
list.add(list.clone());
new JacksonDataCodec().listToString(list);
}
use of com.linkedin.data.codec.JacksonDataCodec in project rest.li by linkedin.
the class TestRestClientRequestBuilder method assertEqualsJsonString.
/**
* Asserts that two JSON strings are semantically equivalent.
* TODO: This seems to be common among unit tests, we should create some framework-wide test utils
*
* @param actual actual JSON string
* @param expected expected JSON string
* @throws IOException in the case of a parsing failure
*/
private void assertEqualsJsonString(String actual, String expected) throws IOException {
JacksonDataCodec codec = new JacksonDataCodec();
Assert.assertEquals(codec.stringToMap(actual), codec.stringToMap(expected));
}
Aggregations