Skip to content

Commit 09b194a

Browse files
committed
test: update APIResponsesResourceTest to cover for null type
1 parent a29a3d9 commit 09b194a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/APIResponsesResourceTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ private Schema getResponseSchema(String path) {
5555
public void testSchemaAPIResource31(String schema) {
5656
Schema responseSchema = getResponseSchema(schema);
5757

58+
String fromGetType = responseSchema.getType() == null ? "null" : responseSchema.getType();
59+
String fromGetTypes = responseSchema.getTypes() == null ? "null" : responseSchema.getTypes().iterator().next().toString();
60+
5861
// Value of field "type" must equal value of field "types"
59-
assertEquals(responseSchema.getType(), responseSchema.getTypes().iterator().next());
62+
assertEquals(fromGetType, fromGetTypes);
6063
}
6164
}

0 commit comments

Comments
 (0)