Commit 20b91295 by jbibik Committed by Tofunmi Adigun-Hameed

Use TestUtil.getPublicMethods instead of getDeclaredMethods

JaCoCo introduces private synthetic methods (even on interfaces) which
have to be skipped when checking that a 'forwarding' implementation does
forward everything. Instead we can use the existing `getPublicMethods()`
method which implicitly skips these (since they're private).

PiperOrigin-RevId: 533130932
(cherry picked from commit 1c104f66e182ce5f9d591375e3b683a3166749ce)
parent c3b6e837
...@@ -72,7 +72,7 @@ public class SimpleBasePlayerTest { ...@@ -72,7 +72,7 @@ public class SimpleBasePlayerTest {
@Test @Test
public void allPlayerInterfaceMethods_declaredFinal() throws Exception { public void allPlayerInterfaceMethods_declaredFinal() throws Exception {
for (Method method : Player.class.getDeclaredMethods()) { for (Method method : TestUtil.getPublicMethods(Player.class)) {
assertThat( assertThat(
SimpleBasePlayer.class SimpleBasePlayer.class
.getMethod(method.getName(), method.getParameterTypes()) .getMethod(method.getName(), method.getParameterTypes())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment