use of com.fasterxml.jackson.dataformat.avro.interop.DummyRecord in project jackson-dataformats-binary by FasterXML.
the class RecordWithComplexTest method testRecordWithRecordValues.
@Test
public void testRecordWithRecordValues() {
RecursiveDummyRecord original = new RecursiveDummyRecord("Hello", 12353, new DummyRecord("World", 234));
//
RecursiveDummyRecord result = roundTrip(RecursiveDummyRecord.class, original);
//
assertThat(result).isEqualTo(original);
}
use of com.fasterxml.jackson.dataformat.avro.interop.DummyRecord in project jackson-dataformats-binary by FasterXML.
the class RecordWithComplexTest method testRecordWithNullRequiredFields.
@Test
public void testRecordWithNullRequiredFields() {
RecursiveDummyRecord original = new RecursiveDummyRecord(null, 12353, new DummyRecord("World", 234));
//
try {
roundTrip(RecursiveDummyRecord.class, original);
fail("Should throw an exception");
} catch (DatabindException e) {
// 28-Feb-2017, tatu: Sometimes we get this (probably when using ObjectWriter)
} catch (NullPointerException e) {
// 28-Feb-2017, tatu: Should NOT just pass NPE, but for now nothing much we can do
// !!! 22-Feb-2021, tatu: Really should figure out how to improve...
}
}
use of com.fasterxml.jackson.dataformat.avro.interop.DummyRecord in project jackson-dataformats-binary by FasterXML.
the class RecordWithComplexTest method testRecordWithListFields.
@Test
public void testRecordWithListFields() throws IOException {
RecursiveDummyRecord original = new RecursiveDummyRecord("Hello", 12353, new DummyRecord("World", 234));
original.requiredList.add(9682584);
//
RecursiveDummyRecord result = roundTrip(RecursiveDummyRecord.class, original);
//
assertThat(result).isEqualTo(original);
assertThat(result.requiredList).isEqualTo(original.requiredList);
}
use of com.fasterxml.jackson.dataformat.avro.interop.DummyRecord in project jackson-dataformats-binary by FasterXML.
the class ListWithComplexTest method testListWithRecordElements.
@Test
public void testListWithRecordElements() throws IOException {
List<DummyRecord> original = new ArrayList<>();
original.add(new DummyRecord("test", 2));
original.add(new DummyRecord("test 2", 1235));
original.add(new DummyRecord("test 3", -234));
//
List<DummyRecord> result = roundTrip(type(List.class, DummyRecord.class), original);
//
assertThat(result).isEqualTo(original);
}
use of com.fasterxml.jackson.dataformat.avro.interop.DummyRecord in project jackson-dataformats-binary by FasterXML.
the class MapWithComplexTest method testMapWithRecordValues.
@Test
public void testMapWithRecordValues() throws IOException {
Map<String, DummyRecord> original = new HashMap<>();
original.put("one", new DummyRecord("test", 2));
original.put("two", new DummyRecord("test 2", 1235));
original.put("three", new DummyRecord("test 3", -234));
//
Map<String, DummyRecord> result = roundTrip(type(Map.class, String.class, DummyRecord.class), original);
//
assertThat(result).isEqualTo(original);
}
Aggregations