From a016817f03bcf23cf10cf9131c62e6df092b9496 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 11 Nov 2013 19:40:33 +0100 Subject: [PATCH] Add tests that verify that a non-existing identity processor is handled. --- .../sone/freenet/wot/IdentityChangeDetectorTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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()); } -- 2.7.4