1212import java .net .InetAddress ;
1313import java .net .UnknownHostException ;
1414import java .util .Arrays ;
15+ import java .util .Collections ;
1516import java .util .List ;
1617import org .junit .jupiter .api .Test ;
1718
@@ -32,7 +33,8 @@ void createParams() throws UnknownHostException, TextParseException {
3233 assertEquals (HTTPSRecord .PORT , port .getKey ());
3334 assertEquals (8443 , port .getPort ());
3435
35- List <Inet4Address > ipv4List = Arrays .asList ((Inet4Address ) InetAddress .getByName ("1.2.3.4" ));
36+ List <Inet4Address > ipv4List =
37+ Collections .singletonList ((Inet4Address ) InetAddress .getByName ("1.2.3.4" ));
3638 HTTPSRecord .ParameterIpv4Hint ipv4hint = new HTTPSRecord .ParameterIpv4Hint (ipv4List );
3739 assertEquals (HTTPSRecord .IPV4HINT , ipv4hint .getKey ());
3840 assertEquals (ipv4List , ipv4hint .getAddresses ());
@@ -42,7 +44,8 @@ void createParams() throws UnknownHostException, TextParseException {
4244 assertEquals (HTTPSRecord .ECHCONFIG , echconfig .getKey ());
4345 assertEquals (data , echconfig .getData ());
4446
45- List <Inet6Address > ipv6List = Arrays .asList ((Inet6Address ) InetAddress .getByName ("2001::1" ));
47+ List <Inet6Address > ipv6List =
48+ Collections .singletonList ((Inet6Address ) InetAddress .getByName ("2001:db8::1" ));
4649 HTTPSRecord .ParameterIpv6Hint ipv6hint = new HTTPSRecord .ParameterIpv6Hint (ipv6List );
4750 assertEquals (HTTPSRecord .IPV6HINT , ipv6hint .getKey ());
4851 assertEquals (ipv6List , ipv6hint .getAddresses ());
@@ -112,10 +115,6 @@ void serviceModeEchConfigMulti() throws IOException {
112115 @ Test
113116 void unknownKey () {
114117 String str = "1 . sport=8443" ;
115- assertThrows (
116- TextParseException .class ,
117- () -> {
118- SVCBRecordTest .stringToWire (str );
119- });
118+ assertThrows (TextParseException .class , () -> SVCBRecordTest .stringToWire (str ));
120119 }
121120}
0 commit comments