From: David ‘Bombe’ Roden Date: Mon, 11 Nov 2013 18:40:33 +0000 (+0100) Subject: Add tests that verify that a non-existing identity processor is handled. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a016817f03bcf23cf10cf9131c62e6df092b9496;p=Sone.git Add tests that verify that a non-existing identity processor is handled. --- diff --git a/src/test/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetectorTest.java b/src/test/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetectorTest.java index d306ace..afe40fa 100644 --- a/src/test/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetectorTest.java +++ b/src/test/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetectorTest.java @@ -155,6 +155,18 @@ public class IdentityChangeDetectorTest { assertThat(unchangedIdentities, containsInAnyOrder(createIdentity1(), createIdentity2())); } + @Test + public void noRemovedIdentitiesAreDetectedWithoutAnIdentityProcessor() { + identityChangeDetector.onRemovedIdentity(null); + identityChangeDetector.detectChanges(asList(createIdentity1(), createIdentity3())); + } + + @Test + public void noAddedIdentitiesAreDetectedWithoutAnIdentityProcessor() { + identityChangeDetector.onNewIdentity(null); + identityChangeDetector.detectChanges(asList(createIdentity1(), createIdentity2(), createIdentity3(), createIdentity4())); + } + private static Collection createOldIdentities() { return asList(createIdentity1(), createIdentity2(), createIdentity3()); }