use of com.bumptech.glide.manager.ConnectivityMonitorFactory in project glide by bumptech.
the class RequestManagerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
connectivityMonitor = mock(ConnectivityMonitor.class);
ConnectivityMonitorFactory factory = mock(ConnectivityMonitorFactory.class);
when(factory.build(isA(Context.class), isA(ConnectivityMonitor.ConnectivityListener.class))).thenAnswer(new Answer<ConnectivityMonitor>() {
@Override
public ConnectivityMonitor answer(InvocationOnMock invocation) throws Throwable {
connectivityListener = (ConnectivityListener) invocation.getArguments()[1];
return connectivityMonitor;
}
});
requestTracker = mock(RequestTracker.class);
manager = new RequestManager(Glide.get(RuntimeEnvironment.application), lifecycle, treeNode, requestTracker, factory);
}
Aggregations