X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FUpdateCheckerTest.java;h=548051a1177280507cf1bf140b291e208b422844;hb=a57dae72e505fec934a9516b88fea75c473f7641;hp=e351d765e623c663c4c89156571a493ca423eb57;hpb=d9d178b845ae83155f22a52e4ea697359864883c;p=Sone.git
diff --git a/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java b/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java
index e351d76..548051a 100644
--- a/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java
+++ b/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java
@@ -5,7 +5,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.mockito.ArgumentCaptor.forClass;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
@@ -17,8 +17,8 @@ import java.io.IOException;
import java.io.InputStream;
import net.pterodactylus.sone.core.FreenetInterface.Callback;
-import net.pterodactylus.sone.core.FreenetInterface.Fetched;
import net.pterodactylus.sone.core.event.UpdateFoundEvent;
+import net.pterodactylus.sone.main.PluginHomepage;
import net.pterodactylus.util.version.Version;
import freenet.client.ClientMetadata;
@@ -36,15 +36,14 @@ import org.mockito.stubbing.Answer;
/**
* Unit test for {@link UpdateChecker}.
- *
- * @author David âBombeâ Roden
*/
public class UpdateCheckerTest {
private final EventBus eventBus = mock(EventBus.class);
private final FreenetInterface freenetInterface = mock(FreenetInterface.class);
private final Version currentVersion = new Version(1, 0, 0);
- private final UpdateChecker updateChecker = new UpdateChecker(eventBus, freenetInterface, currentVersion);
+ private final PluginHomepage pluginHomepage = new PluginHomepage("KSK@homepage");
+ private final UpdateChecker updateChecker = new UpdateChecker(eventBus, freenetInterface, currentVersion, pluginHomepage);
@Before
public void startUpdateChecker() {
@@ -103,9 +102,9 @@ public class UpdateCheckerTest {
private void verifyEventIsFired(Version version, long releaseTime, boolean disruptive) {
ArgumentCaptor updateFoundEvent = forClass(UpdateFoundEvent.class);
verify(eventBus, times(1)).post(updateFoundEvent.capture());
- assertThat(updateFoundEvent.getValue().version(), is(version));
- assertThat(updateFoundEvent.getValue().releaseTime(), is(releaseTime));
- assertThat(updateFoundEvent.getValue().disruptive(), is(disruptive));
+ assertThat(updateFoundEvent.getValue().getVersion(), is(version));
+ assertThat(updateFoundEvent.getValue().getReleaseTime(), is(releaseTime));
+ assertThat(updateFoundEvent.getValue().isDisruptive(), is(disruptive));
}
private void verifyThatUpdateCheckerKnowsLatestVersion(Version version, long releaseTime) {