X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FPreferencesLoaderTest.java;h=d550f25b670afe8e4c1e02634c7e5824a99c6ec9;hp=88745df1b3bdeb5363a34a83af8d2193eab3cdb8;hb=b4d2d68b5ea4f4edc7337f380cfe078756678126;hpb=82e3b3261d2fc90d3893df6d417a2828ce5f8ab3 diff --git a/src/test/java/net/pterodactylus/sone/core/PreferencesLoaderTest.java b/src/test/java/net/pterodactylus/sone/core/PreferencesLoaderTest.java index 88745df..d550f25 100644 --- a/src/test/java/net/pterodactylus/sone/core/PreferencesLoaderTest.java +++ b/src/test/java/net/pterodactylus/sone/core/PreferencesLoaderTest.java @@ -7,7 +7,7 @@ import static org.hamcrest.Matchers.not; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import net.pterodactylus.sone.TestValue; +import net.pterodactylus.sone.test.TestValue; import net.pterodactylus.util.config.Configuration; import com.google.common.eventbus.EventBus; @@ -16,8 +16,6 @@ import org.junit.Test; /** * Unit test for {@link PreferencesLoader}. - * - * @author David ‘Bombe’ Roden */ public class PreferencesLoaderTest { @@ -38,20 +36,20 @@ public class PreferencesLoaderTest { setupIntValue("PositiveTrust", 50); setupIntValue("NegativeTrust", -50); when(configuration.getStringValue("Option/TrustComment")).thenReturn( - new TestValue("Trusted")); + TestValue.from("Trusted")); setupBooleanValue("ActivateFcpInterface", true); setupIntValue("FcpFullAccessRequired", 1); } private void setupIntValue(String optionName, int value) { when(configuration.getIntValue("Option/" + optionName)).thenReturn( - new TestValue(value)); + TestValue.from(value)); } private void setupBooleanValue(String optionName, boolean value) { when(configuration.getBooleanValue( "Option/" + optionName)).thenReturn( - new TestValue(value)); + TestValue.from(value)); } @Test @@ -63,11 +61,11 @@ public class PreferencesLoaderTest { assertThat(preferences.getImagesPerPage(), is(12)); assertThat(preferences.getCharactersPerPost(), is(150)); assertThat(preferences.getPostCutOffLength(), is(300)); - assertThat(preferences.isRequireFullAccess(), is(true)); + assertThat(preferences.getRequireFullAccess(), is(true)); assertThat(preferences.getPositiveTrust(), is(50)); assertThat(preferences.getNegativeTrust(), is(-50)); assertThat(preferences.getTrustComment(), is("Trusted")); - assertThat(preferences.isFcpInterfaceActive(), is(true)); + assertThat(preferences.getFcpInterfaceActive(), is(true)); assertThat(preferences.getFcpFullAccessRequired(), is(WRITING)); }