Skip to content

Commit 85474e9

Browse files
committed
Warnings removal
1 parent e14a22d commit 85474e9

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

avro/src/test/java/tools/jackson/dataformat/avro/AvroTestBase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,14 @@ protected static String aposToQuotes(String json) {
354354
return json.replace("'", "\"");
355355
}
356356

357+
protected static String asJSON(AvroSchema sch) {
358+
return asJSON(sch.getAvroSchema());
359+
}
360+
361+
protected static String asJSON(org.apache.avro.Schema avroSchema) {
362+
return avroSchema.toString(true);
363+
}
364+
357365
/*
358366
/**********************************************************
359367
/* Text generation

avro/src/test/java/tools/jackson/dataformat/avro/EnumTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void testClassEnumWithDefault() throws Exception
161161
AvroSchema schema = gen.getGeneratedSchema();
162162
assertNotNull(schema);
163163

164-
String json = schema.getAvroSchema().toString(true);
164+
String json = asJSON(schema);
165165
assertNotNull(json);
166166

167167
// And read it back too just for fun

avro/src/test/java/tools/jackson/dataformat/avro/schema/AvroSchemaGenerationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void testBasic() throws Exception
110110
AvroSchema schema = gen.getGeneratedSchema();
111111
assertNotNull(schema);
112112

113-
String json = schema.getAvroSchema().toString(true);
113+
String json = asJSON(schema);
114114
assertNotNull(json);
115115

116116
// And read it back too just for fun
@@ -138,7 +138,7 @@ public void testEmployee() throws Exception
138138
AvroSchema schema = gen.getGeneratedSchema();
139139
assertNotNull(schema);
140140

141-
String json = schema.getAvroSchema().toString(true);
141+
String json = asJSON(schema);
142142
assertNotNull(json);
143143
AvroSchema s2 = MAPPER.schemaFrom(json);
144144
assertNotNull(s2);
@@ -170,7 +170,7 @@ public void testMap() throws Exception
170170
AvroSchema schema = gen.getGeneratedSchema();
171171
assertNotNull(schema);
172172

173-
String json = schema.getAvroSchema().toString(true);
173+
String json = asJSON(schema);
174174
assertNotNull(json);
175175
AvroSchema s2 = MAPPER.schemaFrom(json);
176176
assertNotNull(s2);

avro/src/test/java/tools/jackson/dataformat/avro/schema/EnumSchema422Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void testEnumSchemaGeneration422() throws Exception
5757
MAPPER.acceptJsonFormatVisitor(Wrapper422.class, gen);
5858

5959
org.apache.avro.Schema avroSchema = gen.getGeneratedSchema().getAvroSchema();
60-
String avroSchemaInJSON = avroSchema.toString(true);
60+
String avroSchemaInJSON = asJSON(avroSchema);
6161
assertNotNull(avroSchemaInJSON);
6262
}
6363
}

0 commit comments

Comments
 (0)