Skip to content

Commit de4dbcf

Browse files
authored
Merge pull request #1310 from jmini/fix-test-class
Add missing @test annotations in OpenAPIV3ParserTest
2 parents 0439c63 + bf05e04 commit de4dbcf

File tree

1 file changed

+12
-37
lines changed

1 file changed

+12
-37
lines changed

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ public void testIssue1190() {
149149
assertNotNull(openAPI.getComponents().getSchemas().get("SomeObj_lorem"));
150150
}
151151

152-
153-
154152
@Test
155153
public void testIssue1147() {
156154
ParseOptions options = new ParseOptions();
@@ -172,7 +170,6 @@ public void testIssue1148_Flatten_Dot() {
172170
assertEquals(((Schema)apispec.getComponents().getSchemas().get("Some.User").getProperties().get("address")).get$ref(),"#/components/schemas/Some.User_address");
173171
}
174172

175-
176173
@Test
177174
public void testIssue1169() {
178175
ParseOptions options = new ParseOptions();
@@ -205,7 +202,6 @@ public void testIssue1119() {
205202
assertEquals(openAPI.getPaths().get("/pets").getGet().getParameters().get(0).getDescription(),"Cuántos artículos devolver al mismo tiempo (máximo 100)");
206203
}
207204

208-
209205
@Test
210206
public void testIssue1108() {
211207
OpenAPIV3Parser parser = new OpenAPIV3Parser();
@@ -342,11 +338,6 @@ public void testIssue901_2() {
342338
ArraySchema arraySchema = (ArraySchema) openAPI.getComponents().getSchemas().get("Test.Definition").getProperties().get("stuff");
343339
String internalRef = arraySchema.getItems().get$ref();
344340
assertEquals(internalRef,"#/components/schemas/TEST.THING.OUT.Stuff");
345-
346-
347-
348-
349-
350341
}
351342

352343
@Test
@@ -647,13 +638,9 @@ private void tearDownWireMockServer() {
647638
this.wireMockServer.stop();
648639
}
649640

650-
651-
652641
@Test
653642
public void test30(@Injectable final List<AuthorizationValue> auths) throws Exception{
654643

655-
656-
657644
String pathFile = FileUtils.readFileToString(new File("src/test/resources/oas3.yaml.template"));
658645
pathFile = pathFile.replace("${dynamicPort}", String.valueOf(this.serverPort));
659646
ParseOptions options = new ParseOptions();
@@ -682,8 +669,6 @@ public void testResolveFully() throws Exception{
682669
assertEquals(result.getOpenAPI().getComponents().getSchemas().get("OrderRef").getType(),"object");
683670
}
684671

685-
686-
687672
@Test
688673
public void testResolveEmpty(@Injectable final List<AuthorizationValue> auths) throws Exception{
689674
String pathFile = FileUtils.readFileToString(new File("src/test/resources/empty-oas.yaml"));
@@ -716,7 +701,6 @@ public void testResolveFullyExample() throws Exception{
716701
@Test
717702
public void testInlineModelResolver(@Injectable final List<AuthorizationValue> auths) throws Exception{
718703

719-
720704
String pathFile = FileUtils.readFileToString(new File("src/test/resources/flatten.json"));
721705
pathFile = pathFile.replace("${dynamicPort}", String.valueOf(this.serverPort));
722706
ParseOptions options = new ParseOptions();
@@ -748,14 +732,11 @@ public void testRemotePathItemIssue1103(@Injectable final List<AuthorizationValu
748732
Assert.assertEquals(result.getPaths().get("/Translation/{lang}").getPut().getParameters().get(0).getName(), "lang");
749733
}
750734

751-
752-
753735
@Test
754736
public void testRemoteParameterIssue1103(@Injectable final List<AuthorizationValue> auths) throws Exception{
755737
OpenAPI result = new OpenAPIV3Parser().read("issue-1103/remote-parameter-swagger.yaml");
756738
Assert.assertNotNull(result);
757739
Assert.assertEquals(result.getPaths().get("/Translation/{lang}").getPut().getParameters().get(0).getName(), "lang");
758-
759740
}
760741

761742
@Test
@@ -852,8 +833,6 @@ public void testComposedRefResolvingIssue628(@Injectable final List<Authorizatio
852833
Assert.assertNotNull(openAPI.getComponents().getSchemas().get("Pet"));
853834
Assert.assertNotNull(openAPI.getComponents().getSchemas().get("Lion"));
854835
Assert.assertNotNull(openAPI.getComponents().getSchemas().get("Bear"));
855-
856-
857836
}
858837

859838
@Test
@@ -907,9 +886,8 @@ public void testRefPaths() throws Exception {
907886
OpenAPIV3Parser parser = new OpenAPIV3Parser();
908887
OpenAPI openAPI = (parser.readContents(yaml,null,null)).getOpenAPI();
909888
assertEquals(openAPI.getPaths().get("foo"),openAPI.getPaths().get("foo2"));
910-
911-
912889
}
890+
913891
@Test
914892
public void testModelParameters() throws Exception {
915893
String yaml = "openapi: '2.0'\n" +
@@ -934,7 +912,6 @@ public void testModelParameters() throws Exception {
934912

935913
OpenAPIV3Parser parser = new OpenAPIV3Parser();
936914
OpenAPI openAPI = (parser.readContents(yaml,null,null)).getOpenAPI();
937-
938915
}
939916

940917
@Test
@@ -1909,9 +1886,9 @@ public void testIssue948() {
19091886
SwaggerParseResult result = new OpenAPIV3Parser().readLocation("Issue_948.json", null, options);
19101887
new OpenAPIResolver(result.getOpenAPI()).resolve();
19111888
assertNotNull(result.getOpenAPI());
1912-
19131889
}
19141890

1891+
@Test
19151892
public void shouldParseParameters() {
19161893
ParseOptions parseOptions = new ParseOptions();
19171894
parseOptions.setResolveFully(true);
@@ -2051,7 +2028,6 @@ public void shouldParseExternalSchemaModelHavingReferenceToItsLocalModel() {
20512028
assertThat(((Schema) modelSchema.getProperties().get("id")).get$ref(), equalTo("#/components/schemas/ValueId"));
20522029
}
20532030

2054-
20552031
@Test(description = "Test that extensions can be found on the class classloader in addition to tccl.")
20562032
public void testIssue1003_ExtensionsClassloader() {
20572033
ClassLoader tccl = Thread.currentThread().getContextClassLoader();
@@ -2067,7 +2043,7 @@ public void testIssue1003_ExtensionsClassloader() {
20672043
}
20682044
assertNotNull(api);
20692045
}
2070-
2046+
20712047
@Test
20722048
public void shouldParseApiWithMultipleParameterReferences() {
20732049
// given
@@ -2150,8 +2126,9 @@ public void shouldParseApiWithParametersUsingContentvsSchema() {
21502126
assertThat( objectItemSchemas.size(), equalTo(2));
21512127
Assert.assertTrue(objectItemSchemas.get("lat") instanceof IntegerSchema);
21522128
Assert.assertTrue(objectItemSchemas.get("long") instanceof IntegerSchema);
2153-
2154-
}
2129+
}
2130+
2131+
@Test
21552132
public void testIssue1063() {
21562133
// given
21572134
String location = "src/test/resources/issue-1063/openapi.yaml";
@@ -2196,7 +2173,6 @@ public void testIssue1177(@Injectable final List<AuthorizationValue> auths) {
21962173
assertTrue(sessionIdHeader == sessionIdHeaderComponent);
21972174

21982175
assertTrue(petsListApiResponse.getContent().get("application/json").getSchema() == petsListSchema);
2199-
22002176
}
22012177

22022178
@Test
@@ -2256,12 +2232,7 @@ public void testParseOptionsSkipMatchesTrue() {
22562232
assertEquals(6, openAPI.getComponents().getSchemas().size());
22572233
}
22582234

2259-
private static int getDynamicPort() {
2260-
return new Random().ints(10000, 20000).findFirst().getAsInt();
2261-
}
2262-
22632235
@Test
2264-
22652236
public void testIssue1236() {
22662237
final ParseOptions options = new ParseOptions();
22672238
options.setResolve(true);
@@ -2270,6 +2241,8 @@ public void testIssue1236() {
22702241
.readLocation("src/test/resources/issue-1236/petstore.json", null, options);
22712242
assertEquals(result.getMessages().get(0), "attribute .servers. invalid url : /te st/sample.yaml");
22722243
}
2244+
2245+
@Test
22732246
public void testSampleParser() {
22742247
final String location = "src/test/resources/issue-1211.json";
22752248

@@ -2302,6 +2275,8 @@ public void testDuplicateHttpStatusCodes() {
23022275
assertEquals(messages.get(0), "Duplicate field '200' in `src/test/resources/duplicateHttpStatusCodes.json`");
23032276

23042277
}
2305-
2306-
2278+
2279+
private static int getDynamicPort() {
2280+
return new Random().ints(10000, 20000).findFirst().getAsInt();
2281+
}
23072282
}

0 commit comments

Comments
 (0)