Skip to content

Commit

Permalink
AVRO-2560: Convert tests to JUnit 5 (#2287)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanSkraba committed Jun 14, 2023
1 parent d06342a commit f7ba38f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lang/java/avro/src/test/java/org/apache/avro/TestSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,16 +413,16 @@ void qualifiedName() {
assertEquals("Int", nameInt.getQualified("space"));
}

@Test(expected = SchemaParseException.class)
public void testContentAfterAvsc() throws Exception {
@Test
void testContentAfterAvsc() throws Exception {
Schema.Parser parser = new Schema.Parser();
parser.setValidate(true);
parser.setValidateDefaults(true);
parser.parse("{\"type\": \"string\"}; DROP TABLE STUDENTS");
assertThrows(SchemaParseException.class, () -> parser.parse("{\"type\": \"string\"}; DROP TABLE STUDENTS"));
}

@Test
public void testContentAfterAvscInInputStream() throws Exception {
void testContentAfterAvscInInputStream() throws Exception {
Schema.Parser parser = new Schema.Parser();
parser.setValidate(true);
parser.setValidateDefaults(true);
Expand All @@ -432,8 +432,8 @@ public void testContentAfterAvscInInputStream() throws Exception {
assertNotNull(schema);
}

@Test(expected = SchemaParseException.class)
public void testContentAfterAvscInFile() throws Exception {
@Test
void testContentAfterAvscInFile() throws Exception {
File avscFile = Files.createTempFile("testContentAfterAvscInFile", null).toFile();
try (FileWriter writer = new FileWriter(avscFile)) {
writer.write("{\"type\": \"string\"}; DROP TABLE STUDENTS");
Expand All @@ -443,6 +443,6 @@ public void testContentAfterAvscInFile() throws Exception {
Schema.Parser parser = new Schema.Parser();
parser.setValidate(true);
parser.setValidateDefaults(true);
parser.parse(avscFile);
assertThrows(SchemaParseException.class, () -> parser.parse(avscFile));
}
}

0 comments on commit f7ba38f

Please sign in to comment.