Encoder extends MediaCodecPlugin implements ITransform, ISurfaceCreator { @Override public void onSurfaceAvailable(IOnSurfaceReady listener) { listeners.add(listener); } Encoder(IMediaCodec mediaCodec); @Override ISurface getSurface(); @Override ISurface getSimpleSurface(IEglContext eglContext); @Override void checkIfOutputQueueHasData(); @Override void push(Frame frame); @Override void configure(); @Override void onSurfaceAvailable(IOnSurfaceReady listener); @Override void pull(Frame frame); @Override void releaseOutputBuffer(int outputBufferIndex); @Override void setTrackId(int trackId); @Override void close();  }
@Test public void test_onSurfaceAvailable() { VideoEncoder videoEncoder = create.videoEncoder().construct(); IOnSurfaceReady listener = mock(IOnSurfaceReady.class); videoEncoder.onSurfaceAvailable(listener); assertEquals(listener, videoEncoder.listeners.get(0)); }