Add tests that verify that a non-existing identity processor is handled.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 11 Nov 2013 18:40:33 +0000 (19:40 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:59 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/freenet/wot/IdentityChangeDetectorTest.java

index d306ace..afe40fa 100644 (file)
@@ -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<Identity> createOldIdentities() {
                return asList(createIdentity1(), createIdentity2(), createIdentity3());
        }