### Question:
FileProvider implements IPassive, ISeekableProvider, IPullableProvider, IPipeConnectionListener, IStreamTypeAwareProvider { public IMessage pullMessage(IPipe pipe) throws IOException { if (this.pipe == pipe) { if (reader == null) { init(); } if (reader.hasMoreTags()) { IRTMPEvent msg = null; ITag tag = reader.readTag(); if (tag != null) { int timestamp = tag.getTimestamp(); switch (tag.getDataType()) { case Constants.TYPE_AUDIO_DATA: msg = new AudioData(tag.getBody()); break; case Constants.TYPE_VIDEO_DATA: msg = new VideoData(tag.getBody()); break; case Constants.TYPE_INVOKE: msg = new Invoke(tag.getBody()); break; case Constants.TYPE_NOTIFY: msg = new Notify(tag.getBody()); break; case Constants.TYPE_FLEX_STREAM_SEND: msg = new FlexStreamSend(tag.getBody()); break; default: log.warn("Unexpected type? {}", tag.getDataType()); msg = new Unknown(tag.getDataType(), tag.getBody()); } msg.setTimestamp(timestamp); RTMPMessage rtmpMsg = RTMPMessage.build(msg); return rtmpMsg; } else { log.debug("Tag was null"); } } else { } } return null; } FileProvider(IScope scope, File file); void setStart(int start); boolean hasVideo(); IMessage pullMessage(IPipe pipe); IMessage pullMessage(IPipe pipe, long wait); void onPipeConnectionEvent(PipeConnectionEvent event); void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg); int seek(int ts); static final String KEY; }### Answer:
@Test public void test() throws IOException { WebScope scope = (WebScope) applicationContext.getBean("web.scope"); File file = new File("target/test-classes/fixtures/test.flv"); FileProvider provider = new FileProvider(scope, file); IPipe pipe = new InMemoryPullPullPipe(); pipe.subscribe(provider, null); IMessage msg = pipe.pullMessage(); log.info("Message: {}", msg); assertNotNull(msg); }