@@ -165,62 +165,62 @@ private void tearDownWireMockServer() {
165165 public void test$idUrlExternal () throws Exception {
166166 ParseOptions p = new ParseOptions ();
167167 p .setResolve (true );
168- SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-uri-external/root.json" ).getAbsolutePath (), null , p );
168+ SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-uri-external/root.json" ).toURI (). toASCIIString (), null , p );
169169 compare ("$id-uri-external" , swaggerParseResult );
170170 }
171171
172172 @ Test
173173 public void test$idUrlEnclosing () throws Exception {
174174 ParseOptions p = new ParseOptions ();
175175 p .setResolve (true );
176- SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-uri-enclosing/root.json" ).getAbsolutePath (), null , p );
176+ SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-uri-enclosing/root.json" ).toURI (). toASCIIString (), null , p );
177177 compare ("$id-uri-enclosing" , swaggerParseResult );
178178 }
179179
180180 @ Test
181181 public void test$idUrlDirect () throws Exception {
182182 ParseOptions p = new ParseOptions ();
183183 p .setResolve (true );
184- SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-uri-direct/root.json" ).getAbsolutePath (), null , p );
184+ SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-uri-direct/root.json" ).toURI (). toASCIIString (), null , p );
185185 compare ("$id-uri-direct" , swaggerParseResult );
186186 }
187187 @ Test
188188 public void test$idUrlUnresolvable () throws Exception {
189189 ParseOptions p = new ParseOptions ();
190190 p .setResolve (true );
191- SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-unresolvable/root.json" ).getAbsolutePath (), null , p );
191+ SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$id-unresolvable/root.json" ).toURI (). toASCIIString (), null , p );
192192 compare ("$id-unresolvable" , swaggerParseResult );
193193 }
194194
195195 @ Test
196196 public void testAnchorExt () throws Exception {
197197 ParseOptions p = new ParseOptions ();
198198 p .setResolve (true );
199- SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$anchor-external/root.json" ).getAbsolutePath (), null , p );
199+ SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$anchor-external/root.json" ).toURI (). toASCIIString (), null , p );
200200 compare ("$anchor-external" , swaggerParseResult );
201201 }
202202
203203 @ Test
204204 public void testAnchorInt () throws Exception {
205205 ParseOptions p = new ParseOptions ();
206206 p .setResolve (true );
207- SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$anchor-internal/root.json" ).getAbsolutePath (), null , p );
207+ SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$anchor-internal/root.json" ).toURI (). toASCIIString (), null , p );
208208 compare ("$anchor-internal" , swaggerParseResult );
209209 }
210210
211211 @ Test
212212 public void testAnchorUnresolve () throws Exception {
213213 ParseOptions p = new ParseOptions ();
214214 p .setResolve (true );
215- SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$anchor-not-found/root.json" ).getAbsolutePath (), null , p );
215+ SwaggerParseResult swaggerParseResult = new OpenAPIV3Parser ().readLocation (new File ("src/test/resources/3.1.0/dereference/schema/$anchor-not-found/root.json" ).toURI (). toASCIIString (), null , p );
216216 compare ("$anchor-not-found" , swaggerParseResult );
217217 }
218218
219219 public void compare (String dir , SwaggerParseResult result ) throws Exception {
220220 ObjectMapper mapper = Json31 .mapper ().copy ();
221221 mapper .configure (SerializationFeature .ORDER_MAP_ENTRIES_BY_KEYS , true );
222222 mapper .configure (MapperFeature .SORT_PROPERTIES_ALPHABETICALLY , true );
223- String actual = mapper .writer (new DefaultPrettyPrinter ()).writeValueAsString (result .getOpenAPI ());
223+ String actual = mapper .writer (new DefaultPrettyPrinter ()).writeValueAsString (result .getOpenAPI ()). replace ( " \r \n " , " \n " ) ;
224224 org .testng .Assert .assertEquals (actual ,
225225 FileUtils .readFileToString (new File ("src/test/resources/3.1.0/dereference/schema/" + dir + "/dereferenced.json" )));
226226 }
0 commit comments