use of org.prebid.mobile.rendering.loading.VastParserExtractor in project prebid-mobile-android by prebid.
the class CreativeModelsMakerVastTest method getVastParsers.
private List<AdResponseParserBase> getVastParsers(BaseNetworkTask.GetUrlResult adResponse) throws NoSuchFieldException, IllegalAccessException {
final VastParserExtractor.Listener mockListener = mock(VastParserExtractor.Listener.class);
VastParserExtractor parserExtractor = new VastParserExtractor(mockListener);
AsyncVastLoader asyncVastLoader = spy(new AsyncVastLoader());
Field requesterVastField = VastParserExtractor.class.getDeclaredField("mAsyncVastLoader");
requesterVastField.setAccessible(true);
requesterVastField.set(parserExtractor, asyncVastLoader);
parserExtractor.extract(adResponse.responseString);
ArgumentCaptor<VastExtractorResult> varArgsCapture = ArgumentCaptor.forClass(VastExtractorResult.class);
verify(mockListener).onResult(varArgsCapture.capture());
final AdResponseParserBase[] vastResponseParserArray = varArgsCapture.getValue().getVastResponseParserArray();
return Arrays.asList(vastResponseParserArray);
}
Aggregations