|
@@ -46,6 +46,7 @@ import org.mockito.runners.MockitoJUnitRunner;
|
46
|
46
|
import static org.junit.Assert.assertEquals;
|
47
|
47
|
import static org.junit.Assert.assertFalse;
|
48
|
48
|
import static org.junit.Assert.assertTrue;
|
|
49
|
+import static org.mockito.ArgumentMatchers.anyFloat;
|
49
|
50
|
import static org.mockito.Matchers.anyBoolean;
|
50
|
51
|
import static org.mockito.Matchers.anyInt;
|
51
|
52
|
import static org.mockito.Mockito.atLeastOnce;
|
|
@@ -70,7 +71,6 @@ public class DownloaderTest {
|
70
|
71
|
"OMG IM A FAKE DOWNLOAD".getBytes("UTF-8"));
|
71
|
72
|
when(mockedConnection.getInputStream()).thenReturn(is);
|
72
|
73
|
when(mockedConnection.getOutputStream()).thenReturn(os);
|
73
|
|
- when(mockedConnection.getLastModified()).thenReturn(10L, (Long)11L);
|
74
|
74
|
}
|
75
|
75
|
|
76
|
76
|
@Test
|
|
@@ -137,7 +137,7 @@ public class DownloaderTest {
|
137
|
137
|
assertEquals(Lists.newArrayList("OMG IM A FAKE DOWNLOAD"), Files.readAllLines(file,
|
138
|
138
|
Charset.forName("UTF-8")));
|
139
|
139
|
verify(listener).setIndeterminate(anyBoolean());
|
140
|
|
- verify(listener, atLeastOnce()).downloadProgress(anyInt());
|
|
140
|
+ verify(listener, atLeastOnce()).downloadProgress(anyFloat());
|
141
|
141
|
}
|
142
|
142
|
|
143
|
143
|
private class TestableDownloader extends Downloader {
|