Skip to content

Commit

Permalink
Modify test case
Browse files Browse the repository at this point in the history
  • Loading branch information
pingpingy1 committed Feb 15, 2024
1 parent 37c1518 commit e2088eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lang/java/avro/src/test/java/org/apache/avro/TestSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,12 @@ void add_types() {
assertEquals(schemaRecord1, f1.schema());
}

/**
* Tests the behavior of Schema.Parser if its validation option is set to
* `null`. This is then set to the default option `NO_VALIDATION`.
*/
@Test
void testParserNullValidate() {
assertThrows(NullPointerException.class, () -> {
new Schema.Parser(null);
});
new Schema.Parser(null).parse("{\"type\":\"record\",\"name\":\"\",\"fields\":[]}"); // Empty name
}
}

0 comments on commit e2088eb

Please sign in to comment.