Avoid unsupported mock operation

Calling a real method on an interface is not supported by
the Mockito version run by Gradle.

#cherrypick

PiperOrigin-RevId: 737940266
This commit is contained in:
tonihei 2025-03-18 03:38:22 -07:00 committed by Copybara-Service
parent bdc2216492
commit 4daa43b257

View File

@ -233,7 +233,8 @@ public final class DashMediaPeriodTest {
private static DashMediaPeriod createDashMediaPeriod(DashManifest manifest, int periodIndex) { private static DashMediaPeriod createDashMediaPeriod(DashManifest manifest, int periodIndex) {
MediaPeriodId mediaPeriodId = new MediaPeriodId(/* periodUid= */ new Object()); MediaPeriodId mediaPeriodId = new MediaPeriodId(/* periodUid= */ new Object());
DashChunkSource.Factory chunkSourceFactory = mock(DashChunkSource.Factory.class); DashChunkSource.Factory chunkSourceFactory = mock(DashChunkSource.Factory.class);
when(chunkSourceFactory.getOutputTextFormat(any())).thenCallRealMethod(); when(chunkSourceFactory.getOutputTextFormat(any()))
.then(invocation -> invocation.getArguments()[0]);
return new DashMediaPeriod( return new DashMediaPeriod(
/* id= */ periodIndex, /* id= */ periodIndex,
manifest, manifest,