package org.chimi.ipfilter;

import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class IpFiltersTest {
    @Test
    public void createIpFilterWithConfig() {
        IpFilter filter = IpFilters.create(createConfig());
        assertFalse(filter instanceof CachedIpFilter);
        assertTrue(filter instanceof ConfigIpFilter);
    }

    @Test
    public void createCachedIpFilterWithConfig() {
        IpFilter filter = IpFilters.createCached(createConfig());
        assertFalse(filter instanceof ConfigIpFilter);
        assertTrue(filter instanceof CachedIpFilter);
    }

    private Config createConfig() {
        Config config = new Config();
        config.allow("1.2.3.4");
        return config;
    }
}

@@ -50,52 +50,8 @@
 t;%0A%0A
-import static org.junit.Assert.assertFalse;%0A
 impo
@@ -89,16 +89,16 @@
 rtTrue;%0A
+
 %0Apublic 
@@ -238,63 +238,8 @@
 ));%0A
-        assertFalse(filter instanceof CachedIpFilter);%0A
     
@@ -348,32 +348,32 @@
 rWithConfig() %7B%0A
+
         IpFilter
@@ -426,63 +426,8 @@
 ));%0A
-        assertFalse(filter instanceof ConfigIpFilter);%0A
     

delete non-required assert