Parcourir la source

Fix tests after Mockito upgrade.

We were matching a float using anyInt(), which somehow used to
work...
pull/56/head
Chris Smith il y a 7 ans
Parent
révision
e33c482f83
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2
    2
      src/test/java/com/dmdirc/util/io/DownloaderTest.java

+ 2
- 2
src/test/java/com/dmdirc/util/io/DownloaderTest.java Voir le fichier

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

Chargement…
Annuler
Enregistrer