Skip to content

Commit

Permalink
Fix DefaultAnalyticsCollectorTest failure when run with JaCoCo
Browse files Browse the repository at this point in the history
#minor-release

PiperOrigin-RevId: 430189385
  • Loading branch information
icbaker committed Feb 23, 2022
1 parent 62b0440 commit 7e8cfc1
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,18 @@ public final class DefaultAnalyticsCollectorTest {
private EventWindowAndPeriodId window0Period1Seq0;
private EventWindowAndPeriodId window1Period0Seq1;

/**
* Verify that {@link DefaultAnalyticsCollector} explicitly overrides all {@link Player.Listener}
* methods.
*/
@Test
public void defaultAnalyticsCollector_overridesAllPlayerListenerMethods() throws Exception {
// Verify that AnalyticsCollector forwards all Player.Listener methods to AnalyticsListener.
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(
DefaultAnalyticsCollector.class
.getMethod(method.getName(), method.getParameterTypes())
Expand Down

0 comments on commit 7e8cfc1

Please sign in to comment.