use of org.ff4j.strategy.BlackListStrategy in project ff4j by ff4j.
the class ClientFilterStrategyTest method testInitialisationProgram.
@Test
public void testInitialisationProgram() {
FlippingStrategy fs = new ClientFilterStrategy("Pierre, Paul, Jacques");
fs.init("f1", null);
fs.init("f1", new HashMap<String, String>());
new WhiteListStrategy();
new WhiteListStrategy("Pierre");
// Working
new BlackListStrategy();
FlippingStrategy bl2 = new BlackListStrategy("Pierre");
FlippingExecutionContext context = new FlippingExecutionContext();
context.putString("clientHostName", "localhost");
Assert.assertTrue(bl2.evaluate("f1", new InMemoryFeatureStore(), context));
context.putString("clientHostName", "Pierre");
Assert.assertFalse(bl2.evaluate("f1", new InMemoryFeatureStore(), context));
}
Aggregations