use of org.ff4j.core.FlippingExecutionContext in project ff4j by ff4j.
the class FF4jTest method testFlipped.
@Test
public void testFlipped() {
FF4j ff4j = new FF4j().autoCreate(true).createFeature(new Feature("coco", true, "grp2", "", Arrays.asList(new String[] { "ROLEA" })));
Assert.assertTrue(ff4j.check("coco"));
ff4j.setAuthorizationsManager(mockAuthManager);
Assert.assertTrue(ff4j.check("coco"));
FlippingExecutionContext ex = new FlippingExecutionContext();
ex.putString("OK", "OK");
Assert.assertTrue(ff4j.check("coco", ex));
Assert.assertTrue(ff4j.checkOveridingStrategy("coco", mockFlipStrategy));
Assert.assertTrue(ff4j.checkOveridingStrategy("coco", null, null));
Assert.assertFalse(ff4j.checkOveridingStrategy("cocorico", mockFlipStrategy));
// Update Coverage
ff4j.setAuthManager("something");
}
use of org.ff4j.core.FlippingExecutionContext in project ff4j by ff4j.
the class FeatureTest method testFlipExecContext5.
@Test(expected = IllegalArgumentException.class)
public void testFlipExecContext5() {
Map<String, Object> parameters = new HashMap<String, Object>();
FlippingExecutionContext fec = new FlippingExecutionContext();
parameters.put("b", new Integer(1));
fec.getBoolean("b");
fec.getValue("DONOT", true);
}
use of org.ff4j.core.FlippingExecutionContext in project ff4j by ff4j.
the class FeatureTest method testFlipExecContext8.
@Test
public void testFlipExecContext8() {
FlippingExecutionContext fec = new FlippingExecutionContext();
fec.putBoolean("a", new Boolean(true));
fec.putDate("b", new Date());
fec.putDate("c", new Date());
fec.putInt("d", new Integer(1));
fec.putDouble("e", new Double(1D));
}
use of org.ff4j.core.FlippingExecutionContext in project ff4j by ff4j.
the class FeatureTest method testFlipExecContext4.
@Test(expected = IllegalArgumentException.class)
public void testFlipExecContext4() {
Map<String, Object> parameters = new HashMap<String, Object>();
FlippingExecutionContext fec = new FlippingExecutionContext();
parameters.put("b", new Integer(1));
fec.getDate("b");
}
use of org.ff4j.core.FlippingExecutionContext in project ff4j by ff4j.
the class FeatureTest method testFlipExecContext2.
@Test(expected = IllegalArgumentException.class)
public void testFlipExecContext2() {
Map<String, Object> parameters = new HashMap<String, Object>();
FlippingExecutionContext fec = new FlippingExecutionContext();
parameters.put("b", new Double(1));
fec.getInt("b");
}
Aggregations