File tree Expand file tree Collapse file tree
src/test/java/com/github/packageurl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 123123 <version >20240303</version >
124124 <scope >test</scope >
125125 </dependency >
126- <dependency >
127- <groupId >commons-io</groupId >
128- <artifactId >commons-io</artifactId >
129- <version >2.15.1</version >
130- <scope >test</scope >
131- </dependency >
132126 </dependencies >
133127
134128 <build >
Original file line number Diff line number Diff line change 2323
2424import java .io .IOException ;
2525import java .io .InputStream ;
26- import java .nio .charset .StandardCharsets ;
2726import java .util .HashMap ;
2827import java .util .Map ;
2928import java .util .Locale ;
3029import java .util .TreeMap ;
3130
32- import org .apache .commons .io .IOUtils ;
3331import org .json .JSONArray ;
3432import org .json .JSONObject ;
3533import org .junit .AfterClass ;
34+ import org .json .JSONTokener ;
3635import org .junit .Assert ;
3736import org .junit .BeforeClass ;
3837import org .junit .Rule ;
@@ -57,10 +56,11 @@ public class PackageURLTest {
5756
5857 @ BeforeClass
5958 public static void setup () throws IOException {
60- InputStream is = PackageURLTest .class .getResourceAsStream ("/test-suite-data.json" );
61- Assert .assertNotNull (is );
62- String jsonTxt = IOUtils .toString (is , StandardCharsets .UTF_8 );
63- json = new JSONArray (jsonTxt );
59+ try (InputStream is = PackageURLTest .class .getResourceAsStream ("/test-suite-data.json" )) {
60+ Assert .assertNotNull (is );
61+ json = new JSONArray (new JSONTokener (is ));
62+ }
63+
6464 defaultLocale = Locale .getDefault ();
6565 Locale .setDefault (new Locale ("tr" ));
6666 }
You can’t perform that action at this time.
0 commit comments