Skip to content

Commit d2f26e2

Browse files
committed
test: skip tests that can be made under java19
java19 have made InetAddress sealed with permitted subtypes Inet4Address, Inet6Address. Thus we can't mock it anymore. Acked-by: Lea Morschel Target: master
1 parent 4e98f79 commit d2f26e2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

oncrpc4j-core/src/test/java/org/dcache/oncrpc4j/rpc/net/InetSocketAddressesTest.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009 - 2018 Deutsches Elektronen-Synchroton,
2+
* Copyright (c) 2009 - 2022 Deutsches Elektronen-Synchroton,
33
* Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY
44
*
55
* This library is free software; you can redistribute it and/or modify
@@ -24,7 +24,10 @@
2424
import java.net.UnknownHostException;
2525

2626
import org.junit.Test;
27+
28+
import static org.hamcrest.Matchers.lessThanOrEqualTo;
2729
import static org.junit.Assert.*;
30+
import static org.junit.Assume.assumeThat;
2831
import static org.mockito.Mockito.mock;
2932

3033
public class InetSocketAddressesTest {
@@ -130,6 +133,8 @@ public void testTCPv6Netid() throws UnknownHostException {
130133

131134
@Test(expected = IllegalArgumentException.class)
132135
public void testInvalitInetaddressType() throws UnknownHostException {
136+
// java19 have made InetAddress sealed with permitted subtypes Inet4Address, Inet6Address
137+
assumeThat(Runtime.version().feature(), lessThanOrEqualTo(11));
133138
InetAddress address = mock(InetAddress.class); // not a direct instance of Inet4/6Address
134139
assertEquals("invalid netid", "tcp6", InetSocketAddresses.tcpNetidOf(address));
135140
}

0 commit comments

Comments
 (0)