This commit is contained in:
Yuqi Yan 2026-08-01 14:12:04 +03:00 committed by GitHub
commit 34506ddccc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -118,6 +119,11 @@ public class JMXStandardsTest
.add(Exception.class) .add(Exception.class)
.build(); .build();
/**
* These are the method names that shouldn't be included in this test
*/
private static final Set<String> IGNORE_METHODS = ImmutableSet.of("$jacocoInit");
@Test @Test
public void interfaces() throws ClassNotFoundException public void interfaces() throws ClassNotFoundException
{ {
@ -134,7 +140,9 @@ public class JMXStandardsTest
for (Class<?> klass = Class.forName(className); klass != null && !Object.class.equals(klass); klass = klass.getSuperclass()) for (Class<?> klass = Class.forName(className); klass != null && !Object.class.equals(klass); klass = klass.getSuperclass())
{ {
Assertions.assertThat(klass).isInterface(); Assertions.assertThat(klass).isInterface();
Method[] methods = klass.getDeclaredMethods(); Method[] methods = Arrays.stream(klass.getDeclaredMethods())
.filter(m -> !IGNORE_METHODS.contains(m.getName()))
.toArray(Method[]::new);
for (int i = 0; i < methods.length; i++) for (int i = 0; i < methods.length; i++)
{ {
Method method = methods[i]; Method method = methods[i];