use of org.ff4j.strategy.el.ExpressionFlipStrategy in project ff4j by ff4j.
the class ExpressionFlipStategyTest method testExplicitevaluate.
@Test
public void testExplicitevaluate() {
ExpressionFlipStrategy efs = new ExpressionFlipStrategy();
Assert.assertTrue(efs.evaluate("D", ff4j.getFeatureStore(), null));
Assert.assertTrue(efs.evaluate("TOTO", ff4j.getFeatureStore(), null));
FlippingExecutionContext fex = new FlippingExecutionContext();
fex.putString(ExpressionFlipStrategy.PARAM_EXPRESSION, "D");
Assert.assertTrue(efs.evaluate("D", ff4j.getFeatureStore(), fex));
fex.putString(ExpressionFlipStrategy.PARAM_EXPRESSION, "TOTO");
Assert.assertFalse(efs.evaluate("D", ff4j.getFeatureStore(), fex));
}
use of org.ff4j.strategy.el.ExpressionFlipStrategy in project ff4j by ff4j.
the class FF4jTest method testOverrideStrategy.
@Test
public void testOverrideStrategy() {
FF4j ff4j = new FF4j();
ff4j.audit();
ff4j.createFeature("N1", true, "description NEWS");
ff4j.createFeature("N2", false, "description NEWS");
Assert.assertTrue(ff4j.check("N1"));
Assert.assertFalse(ff4j.checkOveridingStrategy("N1", new ExpressionFlipStrategy("N1", "N1 & N2")));
}
Aggregations