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 620b9e15403b5138e7b3f44194b10e5ae7f72a8c)
This commit is contained in:
jbibik 2023-05-18 16:06:43 +01:00 committed by Tofunmi Adigun-Hameed
parent 400218c018
commit 9c1a80082f

View File

@ -65,7 +65,7 @@ public class SimpleBasePlayerTest {
@Test
public void allPlayerInterfaceMethods_declaredFinal() throws Exception {
for (Method method : Player.class.getDeclaredMethods()) {
for (Method method : TestUtil.getPublicMethods(Player.class)) {
assertThat(
SimpleBasePlayer.class
.getMethod(method.getName(), method.getParameterTypes())