Skip to content

Commit c8a09d3

Browse files
committed
Remove some of exception wrapping to help debugging
1 parent d26339a commit c8a09d3

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/interop/ApacheAvroInteropUtil.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,8 @@ public static Schema getJacksonSchema(Type type) {
228228
*
229229
* @return Deserialized payload
230230
*/
231-
public static <T> T jacksonDeserialize(Schema schema, JavaType type, byte[] data) {
232-
try {
233-
return MAPPER.readerFor(type).with(new AvroSchema(schema)).readValue(data, 0, data.length);
234-
} catch (IOException e) {
235-
throw new RuntimeException("Failed to Deserialize", e);
236-
}
231+
public static <T> T jacksonDeserialize(Schema schema, JavaType type, byte[] data) throws IOException {
232+
return MAPPER.readerFor(type).with(new AvroSchema(schema)).readValue(data, 0, data.length);
237233
}
238234

239235
/**

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/interop/annotations/AvroDefaultTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ static class RecordWithDefaults {
1919
}
2020

2121
@Test
22-
public void testUnionBooleanDefault() {
22+
public void testUnionBooleanDefault() throws Exception {
2323
Schema apacheSchema = ApacheAvroInteropUtil.getApacheSchema(RecordWithDefaults.class);
2424
Schema jacksonSchema = ApacheAvroInteropUtil.getJacksonSchema(RecordWithDefaults.class);
2525
//
2626
assertThat(jacksonSchema.getField("booleanField").defaultVal()).isEqualTo(apacheSchema.getField("booleanField").defaultVal());
2727
}
2828

2929
@Test
30-
public void testUnionIntegerDefault() {
30+
public void testUnionIntegerDefault() throws Exception {
3131
Schema apacheSchema = ApacheAvroInteropUtil.getApacheSchema(RecordWithDefaults.class);
3232
Schema jacksonSchema = ApacheAvroInteropUtil.getJacksonSchema(RecordWithDefaults.class);
3333
//
3434
assertThat(jacksonSchema.getField("intField").defaultVal()).isEqualTo(apacheSchema.getField("intField").defaultVal());
3535
}
3636

3737
@Test
38-
public void testUnionStringDefault() {
38+
public void testUnionStringDefault() throws Exception {
3939
Schema apacheSchema = ApacheAvroInteropUtil.getApacheSchema(RecordWithDefaults.class);
4040
Schema jacksonSchema = ApacheAvroInteropUtil.getJacksonSchema(RecordWithDefaults.class);
4141
//

avro/src/test/java/com/fasterxml/jackson/dataformat/avro/interop/annotations/AvroEncodeTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ static class CustomComponent {
5656
protected CustomComponent() { }
5757
}
5858

59+
@SuppressWarnings("unchecked")
5960
public static class ApacheImplEncoding extends CustomEncoding<CustomComponent> {
6061

6162
public ApacheImplEncoding() {

0 commit comments

Comments
 (0)