@@ -83,16 +83,16 @@ void validPercentEncoding() throws MalformedPackageURLException {
8383 @ SuppressWarnings ("deprecation" )
8484 @ Test
8585 void invalidPercentEncoding () throws MalformedPackageURLException {
86- assertThrows (MalformedPackageURLException .class , () -> new PackageURL ("pkg:maven/com.google.summit/summit-ast@2.2.0%" ));
87- assertThrows (MalformedPackageURLException .class , () -> new PackageURL ("pkg:maven/com.google.summit/summit-ast@2.2.0%0" ));
86+ assertThrowsExactly (MalformedPackageURLException .class , () -> new PackageURL ("pkg:maven/com.google.summit/summit-ast@2.2.0%" ));
87+ assertThrowsExactly (MalformedPackageURLException .class , () -> new PackageURL ("pkg:maven/com.google.summit/summit-ast@2.2.0%0" ));
8888 PackageURL purl = new PackageURL ("pkg:maven/com.google.summit/summit-ast@2.2.0" );
89- Throwable t1 = assertThrows (ValidationException .class , () -> purl .uriDecode ("%" ));
89+ Throwable t1 = assertThrowsExactly (ValidationException .class , () -> purl .uriDecode ("%" ));
9090 assertEquals ("Incomplete percent encoding at offset 0 with value '%'" , t1 .getMessage ());
91- Throwable t2 = assertThrows (ValidationException .class , () -> purl .uriDecode ("a%0" ));
91+ Throwable t2 = assertThrowsExactly (ValidationException .class , () -> purl .uriDecode ("a%0" ));
9292 assertEquals ("Incomplete percent encoding at offset 1 with value '%0'" , t2 .getMessage ());
93- Throwable t3 = assertThrows (ValidationException .class , () -> purl .uriDecode ("aaaa%%0A" ));
93+ Throwable t3 = assertThrowsExactly (ValidationException .class , () -> purl .uriDecode ("aaaa%%0A" ));
9494 assertEquals ("Invalid percent encoding char 1 at offset 5 with value '%'" , t3 .getMessage ());
95- Throwable t4 = assertThrows (ValidationException .class , () -> purl .uriDecode ("%0G" ));
95+ Throwable t4 = assertThrowsExactly (ValidationException .class , () -> purl .uriDecode ("%0G" ));
9696 assertEquals ("Invalid percent encoding char 2 at offset 2 with value 'G'" , t4 .getMessage ());
9797 }
9898
0 commit comments