X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FAbstractSoneBuilderTest.java;fp=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2Fimpl%2FAbstractSoneBuilderTest.java;h=9b64b6a2c4e7f88eaee6e17c9c365365d195abd2;hp=6bd40b67550b0f0202cdd42249199286af57d2d6;hb=fd9d1edd9eef0dff1e9dd17a6bc55cb9e4da8f9f;hpb=c11c930c16c76baae664096b43be52e43302ba1b diff --git a/src/test/java/net/pterodactylus/sone/data/impl/AbstractSoneBuilderTest.java b/src/test/java/net/pterodactylus/sone/data/impl/AbstractSoneBuilderTest.java index 6bd40b6..9b64b6a 100644 --- a/src/test/java/net/pterodactylus/sone/data/impl/AbstractSoneBuilderTest.java +++ b/src/test/java/net/pterodactylus/sone/data/impl/AbstractSoneBuilderTest.java @@ -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(); } }