Search in sources :

Example 1 with AsyncVastLoader

use of org.prebid.mobile.rendering.networking.modelcontrollers.AsyncVastLoader 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);
}
Also used : Field(java.lang.reflect.Field) AsyncVastLoader(org.prebid.mobile.rendering.networking.modelcontrollers.AsyncVastLoader) VastParserExtractor(org.prebid.mobile.rendering.loading.VastParserExtractor) AdResponseParserBase(org.prebid.mobile.rendering.parser.AdResponseParserBase) VastExtractorResult(org.prebid.mobile.rendering.models.internal.VastExtractorResult)

Aggregations

Field (java.lang.reflect.Field)1 VastParserExtractor (org.prebid.mobile.rendering.loading.VastParserExtractor)1 VastExtractorResult (org.prebid.mobile.rendering.models.internal.VastExtractorResult)1 AsyncVastLoader (org.prebid.mobile.rendering.networking.modelcontrollers.AsyncVastLoader)1 AdResponseParserBase (org.prebid.mobile.rendering.parser.AdResponseParserBase)1