Commit 1b5a0c11 by ibaker Committed by Ian Baker

Fix DefaultAnalyticsCollectorTest failure when run with JaCoCo

#minor-release

PiperOrigin-RevId: 430189385
parent 19e21d6f
...@@ -192,10 +192,18 @@ public final class DefaultAnalyticsCollectorTest { ...@@ -192,10 +192,18 @@ public final class DefaultAnalyticsCollectorTest {
private EventWindowAndPeriodId window0Period1Seq0; private EventWindowAndPeriodId window0Period1Seq0;
private EventWindowAndPeriodId window1Period0Seq1; private EventWindowAndPeriodId window1Period0Seq1;
/**
* Verify that {@link DefaultAnalyticsCollector} explicitly overrides all {@link Player.Listener}
* methods.
*/
@Test @Test
public void defaultAnalyticsCollector_overridesAllPlayerListenerMethods() throws Exception { public void defaultAnalyticsCollector_overridesAllPlayerListenerMethods() throws Exception {
// Verify that AnalyticsCollector forwards all Player.Listener methods to AnalyticsListener.
for (Method method : Player.Listener.class.getDeclaredMethods()) { for (Method method : Player.Listener.class.getDeclaredMethods()) {
if (method.isSynthetic()) {
// JaCoCo inserts synthetic methods. See "My code uses reflection. Why does it fail when I
// execute it with JaCoCo?": https://www.eclemma.org/jacoco/trunk/doc/faq.html
continue;
}
assertThat( assertThat(
DefaultAnalyticsCollector.class DefaultAnalyticsCollector.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