Make the update time of a Sone final, set it in the Sone builder.
[Sone.git] / src / test / java / net / pterodactylus / sone / data / impl / AbstractSoneBuilderTest.java
index 6bd40b6..9b64b6a 100644 (file)
@@ -26,29 +26,41 @@ public class AbstractSoneBuilderTest {
        @Test
        public void localSoneIsValidated() {
                Identity ownIdentity = mock(OwnIdentity.class);
-               soneBuilder.local().from(ownIdentity).build();
+               soneBuilder.local().from(ownIdentity).lastUpdated(1).build();
        }
 
        @Test(expected = IllegalStateException.class)
        public void localSoneIsNotValidatedIfIdentityIsNotAnOwnIdentity() {
                Identity identity = mock(Identity.class);
-               soneBuilder.local().from(identity).build();
+               soneBuilder.local().from(identity).lastUpdated(1).build();
        }
 
        @Test(expected = IllegalStateException.class)
        public void localSoneIsNotValidatedIfIdentityIsNull() {
-               soneBuilder.local().build();
+               soneBuilder.local().lastUpdated(1).build();
        }
 
        @Test
        public void remoteSoneIsValidated() {
                Identity identity = mock(Identity.class);
-               soneBuilder.from(identity).build();
+               soneBuilder.from(identity).lastUpdated(1).build();
        }
 
        @Test(expected = IllegalStateException.class)
        public void remoteSoneIsNotValidatedIfIdentityIsNull() {
-               soneBuilder.build();
+               soneBuilder.lastUpdated(1).build();
+       }
+
+       @Test(expected = IllegalStateException.class)
+       public void localSoneIsNotValidatedWithoutUpdateTime() {
+               Identity identity = mock(OwnIdentity.class);
+               soneBuilder.from(identity).local().build();
+       }
+
+       @Test(expected = IllegalStateException.class)
+       public void remoteSoneIsNotValidatedWithoutUpdateTime() {
+               Identity identity = mock(Identity.class);
+               soneBuilder.from(identity).build();
        }
 
 }