Skip to content

Commit 935b75c

Browse files
authored
Do not mock ByteBuffer in unit tests (#284)
1 parent 2881caf commit 935b75c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

litr/src/test/java/com/linkedin/android/litr/transcoder/PassthroughTranscoderShould.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@ public class PassthroughTranscoderShould {
4141
private static final long SAMPLE_TIME = 21;
4242
private static final int BUFFER_SIZE = 512;
4343

44+
private final ByteBuffer outputBuffer = ByteBuffer.allocate(1);
45+
4446
private static final long CURRENT_PRESENTATION_TIME = 42;
4547
private static final long SELECTION_START = 16;
4648
private static final long SELECTION_END = 64;
4749

4850
@Mock private MediaSource mediaSource;
4951
@Mock private MediaTarget mediaTarget;
5052
@Mock private MediaCodec.BufferInfo outputBufferInfo;
51-
@Mock private ByteBuffer outputBuffer;
5253

5354
@Mock private MediaFormat sourceMediaFormat;
5455

@@ -59,7 +60,7 @@ public class PassthroughTranscoderShould {
5960

6061
@Before
6162
public void setup() throws Exception {
62-
MockitoAnnotations.initMocks(this);
63+
MockitoAnnotations.openMocks(this);
6364

6465
fullMediaRange = new MediaRange(0, Long.MAX_VALUE);
6566
trimmedMediaRange = new MediaRange(SELECTION_START, SELECTION_END);

0 commit comments

Comments
 (0)