use of org.ff4j.FF4j in project ff4j by ff4j.
the class FF4jTest method readFeatureNotFound.
@Test(expected = FeatureNotFoundException.class)
public void readFeatureNotFound() {
// Given
FF4j ff4j = new FF4j();
// When
ff4j.getFeature("i-dont-exist");
// Then
// expect error...
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FF4jTest method testGetFeatures.
@Test
public void testGetFeatures() {
FF4j ff4j = new FF4j("ff4j.xml");
Assert.assertEquals(5, ff4j.getFeatures().size());
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FF4jTest method testDisableWithAudit.
@Test
public void testDisableWithAudit() {
// Given
FF4j ff4j = new FF4j(getClass().getClassLoader().getResourceAsStream("ff4j.xml"));
ff4j.audit();
Assert.assertTrue(ff4j.exist(F1));
Assert.assertTrue(ff4j.getFeature(F1).isEnable());
// When
ff4j.disable(F1);
// Then
Assert.assertFalse(ff4j.getFeature(F1).isEnable());
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FF4jTest method testDeleteFeature.
@Test
public void testDeleteFeature() {
FF4j ff4j = new FF4j("ff4j.xml");
ff4j.audit();
Assert.assertTrue(ff4j.exist(F1));
ff4j.delete(F1);
Assert.assertFalse(ff4j.exist(F1));
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class AuditBeanTest method testEventBuider.
@Test
public void testEventBuider() {
FF4j ff4j = new FF4j();
ff4j.setAuthorizationsManager(new DefinedPermissionSecurityManager("a", Util.set("1", "2")));
EventBuilder eb = new EventBuilder(ff4j);
eb.name("FeatureX");
Assert.assertEquals("a", eb.build().getUser());
}
Aggregations