Update years in copyright line
[Sone.git] / src / test / java / net / pterodactylus / sone / database / memory / MemoryDatabaseTest.java
index f7b07a2..5ee498c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - MemoryDatabaseTest.java - Copyright © 2013 David Roden
+ * Sone - MemoryDatabaseTest.java - Copyright © 2013–2015 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -278,11 +278,11 @@ public class MemoryDatabaseTest {
 
        private void initializeFriends() {
                when(configuration.getStringValue("Sone/" + SONE_ID + "/Friends/0/ID")).thenReturn(
-                               new TestValue<String>("Friend1"));
+                               TestValue.from("Friend1"));
                when(configuration.getStringValue("Sone/" + SONE_ID + "/Friends/1/ID")).thenReturn(
-                               new TestValue<String>("Friend2"));
+                               TestValue.from("Friend2"));
                when(configuration.getStringValue("Sone/" + SONE_ID + "/Friends/2/ID")).thenReturn(
-                               new TestValue<String>(null));
+                               TestValue.<String>from(null));
        }
 
        @Test
@@ -332,7 +332,7 @@ public class MemoryDatabaseTest {
                when(configuration.getStringValue(anyString())).thenAnswer(new Answer<Value<String>>() {
                        @Override
                        public Value<String> answer(InvocationOnMock invocation) throws Throwable {
-                               Value<String> stringValue = new TestValue(null);
+                               Value<String> stringValue = TestValue.from(null);
                                configurationValues.put((String) invocation.getArguments()[0], stringValue);
                                return stringValue;
                        }
@@ -363,7 +363,7 @@ public class MemoryDatabaseTest {
                when(sone.isLocal()).thenReturn(true);
                memoryDatabase.addFriend(sone, "Friend1");
                memoryDatabase.addFriend(sone, "Friend1");
-               verify(configuration, times(2)).getStringValue(anyString());
+               verify(configuration, times(3)).getStringValue(anyString());
        }
 
        @Test
@@ -380,9 +380,10 @@ public class MemoryDatabaseTest {
 
        @Test
        public void configurationIsNotWrittenWhenANonFriendIsRemoved() {
+               prepareConfigurationValues();
                when(sone.isLocal()).thenReturn(true);
                memoryDatabase.removeFriend(sone, "Friend1");
-               verify(configuration, never()).getStringValue(anyString());
+               verify(configuration).getStringValue(anyString());
        }
 
 }