@@ -149,8 +149,6 @@ public void testIssue1190() {
149
149
assertNotNull (openAPI .getComponents ().getSchemas ().get ("SomeObj_lorem" ));
150
150
}
151
151
152
-
153
-
154
152
@ Test
155
153
public void testIssue1147 () {
156
154
ParseOptions options = new ParseOptions ();
@@ -172,7 +170,6 @@ public void testIssue1148_Flatten_Dot() {
172
170
assertEquals (((Schema )apispec .getComponents ().getSchemas ().get ("Some.User" ).getProperties ().get ("address" )).get$ref (),"#/components/schemas/Some.User_address" );
173
171
}
174
172
175
-
176
173
@ Test
177
174
public void testIssue1169 () {
178
175
ParseOptions options = new ParseOptions ();
@@ -205,7 +202,6 @@ public void testIssue1119() {
205
202
assertEquals (openAPI .getPaths ().get ("/pets" ).getGet ().getParameters ().get (0 ).getDescription (),"Cuántos artículos devolver al mismo tiempo (máximo 100)" );
206
203
}
207
204
208
-
209
205
@ Test
210
206
public void testIssue1108 () {
211
207
OpenAPIV3Parser parser = new OpenAPIV3Parser ();
@@ -342,11 +338,6 @@ public void testIssue901_2() {
342
338
ArraySchema arraySchema = (ArraySchema ) openAPI .getComponents ().getSchemas ().get ("Test.Definition" ).getProperties ().get ("stuff" );
343
339
String internalRef = arraySchema .getItems ().get$ref ();
344
340
assertEquals (internalRef ,"#/components/schemas/TEST.THING.OUT.Stuff" );
345
-
346
-
347
-
348
-
349
-
350
341
}
351
342
352
343
@ Test
@@ -647,13 +638,9 @@ private void tearDownWireMockServer() {
647
638
this .wireMockServer .stop ();
648
639
}
649
640
650
-
651
-
652
641
@ Test
653
642
public void test30 (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
654
643
655
-
656
-
657
644
String pathFile = FileUtils .readFileToString (new File ("src/test/resources/oas3.yaml.template" ));
658
645
pathFile = pathFile .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
659
646
ParseOptions options = new ParseOptions ();
@@ -682,8 +669,6 @@ public void testResolveFully() throws Exception{
682
669
assertEquals (result .getOpenAPI ().getComponents ().getSchemas ().get ("OrderRef" ).getType (),"object" );
683
670
}
684
671
685
-
686
-
687
672
@ Test
688
673
public void testResolveEmpty (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
689
674
String pathFile = FileUtils .readFileToString (new File ("src/test/resources/empty-oas.yaml" ));
@@ -716,7 +701,6 @@ public void testResolveFullyExample() throws Exception{
716
701
@ Test
717
702
public void testInlineModelResolver (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
718
703
719
-
720
704
String pathFile = FileUtils .readFileToString (new File ("src/test/resources/flatten.json" ));
721
705
pathFile = pathFile .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
722
706
ParseOptions options = new ParseOptions ();
@@ -748,14 +732,11 @@ public void testRemotePathItemIssue1103(@Injectable final List<AuthorizationValu
748
732
Assert .assertEquals (result .getPaths ().get ("/Translation/{lang}" ).getPut ().getParameters ().get (0 ).getName (), "lang" );
749
733
}
750
734
751
-
752
-
753
735
@ Test
754
736
public void testRemoteParameterIssue1103 (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
755
737
OpenAPI result = new OpenAPIV3Parser ().read ("issue-1103/remote-parameter-swagger.yaml" );
756
738
Assert .assertNotNull (result );
757
739
Assert .assertEquals (result .getPaths ().get ("/Translation/{lang}" ).getPut ().getParameters ().get (0 ).getName (), "lang" );
758
-
759
740
}
760
741
761
742
@ Test
@@ -852,8 +833,6 @@ public void testComposedRefResolvingIssue628(@Injectable final List<Authorizatio
852
833
Assert .assertNotNull (openAPI .getComponents ().getSchemas ().get ("Pet" ));
853
834
Assert .assertNotNull (openAPI .getComponents ().getSchemas ().get ("Lion" ));
854
835
Assert .assertNotNull (openAPI .getComponents ().getSchemas ().get ("Bear" ));
855
-
856
-
857
836
}
858
837
859
838
@ Test
@@ -907,9 +886,8 @@ public void testRefPaths() throws Exception {
907
886
OpenAPIV3Parser parser = new OpenAPIV3Parser ();
908
887
OpenAPI openAPI = (parser .readContents (yaml ,null ,null )).getOpenAPI ();
909
888
assertEquals (openAPI .getPaths ().get ("foo" ),openAPI .getPaths ().get ("foo2" ));
910
-
911
-
912
889
}
890
+
913
891
@ Test
914
892
public void testModelParameters () throws Exception {
915
893
String yaml = "openapi: '2.0'\n " +
@@ -934,7 +912,6 @@ public void testModelParameters() throws Exception {
934
912
935
913
OpenAPIV3Parser parser = new OpenAPIV3Parser ();
936
914
OpenAPI openAPI = (parser .readContents (yaml ,null ,null )).getOpenAPI ();
937
-
938
915
}
939
916
940
917
@ Test
@@ -1909,9 +1886,9 @@ public void testIssue948() {
1909
1886
SwaggerParseResult result = new OpenAPIV3Parser ().readLocation ("Issue_948.json" , null , options );
1910
1887
new OpenAPIResolver (result .getOpenAPI ()).resolve ();
1911
1888
assertNotNull (result .getOpenAPI ());
1912
-
1913
1889
}
1914
1890
1891
+ @ Test
1915
1892
public void shouldParseParameters () {
1916
1893
ParseOptions parseOptions = new ParseOptions ();
1917
1894
parseOptions .setResolveFully (true );
@@ -2051,7 +2028,6 @@ public void shouldParseExternalSchemaModelHavingReferenceToItsLocalModel() {
2051
2028
assertThat (((Schema ) modelSchema .getProperties ().get ("id" )).get$ref (), equalTo ("#/components/schemas/ValueId" ));
2052
2029
}
2053
2030
2054
-
2055
2031
@ Test (description = "Test that extensions can be found on the class classloader in addition to tccl." )
2056
2032
public void testIssue1003_ExtensionsClassloader () {
2057
2033
ClassLoader tccl = Thread .currentThread ().getContextClassLoader ();
@@ -2067,7 +2043,7 @@ public void testIssue1003_ExtensionsClassloader() {
2067
2043
}
2068
2044
assertNotNull (api );
2069
2045
}
2070
-
2046
+
2071
2047
@ Test
2072
2048
public void shouldParseApiWithMultipleParameterReferences () {
2073
2049
// given
@@ -2150,8 +2126,9 @@ public void shouldParseApiWithParametersUsingContentvsSchema() {
2150
2126
assertThat ( objectItemSchemas .size (), equalTo (2 ));
2151
2127
Assert .assertTrue (objectItemSchemas .get ("lat" ) instanceof IntegerSchema );
2152
2128
Assert .assertTrue (objectItemSchemas .get ("long" ) instanceof IntegerSchema );
2153
-
2154
- }
2129
+ }
2130
+
2131
+ @ Test
2155
2132
public void testIssue1063 () {
2156
2133
// given
2157
2134
String location = "src/test/resources/issue-1063/openapi.yaml" ;
@@ -2196,7 +2173,6 @@ public void testIssue1177(@Injectable final List<AuthorizationValue> auths) {
2196
2173
assertTrue (sessionIdHeader == sessionIdHeaderComponent );
2197
2174
2198
2175
assertTrue (petsListApiResponse .getContent ().get ("application/json" ).getSchema () == petsListSchema );
2199
-
2200
2176
}
2201
2177
2202
2178
@ Test
@@ -2256,12 +2232,7 @@ public void testParseOptionsSkipMatchesTrue() {
2256
2232
assertEquals (6 , openAPI .getComponents ().getSchemas ().size ());
2257
2233
}
2258
2234
2259
- private static int getDynamicPort () {
2260
- return new Random ().ints (10000 , 20000 ).findFirst ().getAsInt ();
2261
- }
2262
-
2263
2235
@ Test
2264
-
2265
2236
public void testIssue1236 () {
2266
2237
final ParseOptions options = new ParseOptions ();
2267
2238
options .setResolve (true );
@@ -2270,6 +2241,8 @@ public void testIssue1236() {
2270
2241
.readLocation ("src/test/resources/issue-1236/petstore.json" , null , options );
2271
2242
assertEquals (result .getMessages ().get (0 ), "attribute .servers. invalid url : /te st/sample.yaml" );
2272
2243
}
2244
+
2245
+ @ Test
2273
2246
public void testSampleParser () {
2274
2247
final String location = "src/test/resources/issue-1211.json" ;
2275
2248
@@ -2302,6 +2275,8 @@ public void testDuplicateHttpStatusCodes() {
2302
2275
assertEquals (messages .get (0 ), "Duplicate field '200' in `src/test/resources/duplicateHttpStatusCodes.json`" );
2303
2276
2304
2277
}
2305
-
2306
-
2278
+
2279
+ private static int getDynamicPort () {
2280
+ return new Random ().ints (10000 , 20000 ).findFirst ().getAsInt ();
2281
+ }
2307
2282
}
0 commit comments