use of org.ff4j.FF4j in project ff4j by ff4j.
the class InMemoryPropertiesStoreTest method testProperty.
public void testProperty() {
FF4j ff4j = new FF4j("ff4j.xml");
ff4j.getPropertiesStore().createProperty(new PropertyDate("property_3", new Date()));
Property<?> ap = ff4j.getPropertiesStore().readProperty("property_3");
PropertyDate pDate = (PropertyDate) ap;
pDate.setValue(new Date());
ff4j.getPropertiesStore().updateProperty(pDate);
ff4j.getPropertiesStore().deleteProperty("property_3");
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FeatureJsonMarshallTest method marshallOfficeHourFlippingStrategy.
/**
* TDD.
*/
@Test
@Ignore
public void marshallOfficeHourFlippingStrategy() throws Exception {
// When-Then
Feature f = new FF4j("test-strategy-officehour.xml").getFeature("first");
assertMarshalling(f);
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class ApiConfigTest method testApiConfig.
@Test
public void testApiConfig() {
ApiConfig apc1 = new ApiConfig();
apc1.setVersion("1");
apc1.getVersion();
apc1.isAuthenticate();
apc1.isAutorize();
apc1.isDocumentation();
apc1.isLog();
apc1.setFF4j(new FF4j());
apc1.getFF4j();
apc1.setApiKeys(Util.set("1", "2"));
apc1.getApiKeys();
apc1.setAuthenticate(false);
apc1.setAutorize(false);
apc1.setHost("localhost");
apc1.getHost();
apc1.setPort(8080);
apc1.getPort();
apc1.setPermissions(new HashMap<String, Set<String>>());
apc1.getPermissions();
apc1.setLog(false);
apc1.setUsers(new HashMap<String, String>());
apc1.getUsers();
apc1.getWebContext();
apc1.getContextPath();
apc1.createApiKey("key", true, true, Util.set("USER", "ADMIN"));
apc1.createUser("john", "tiger", true, true, Util.set("USER", "ADMIN"));
apc1.setFF4j(new FF4j());
new ApiConfigBuilder(apc1);
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class ApiConfigTest method tesApiConfigBuilder.
@Test
public void tesApiConfigBuilder() {
ApiConfigBuilder b = new ApiConfigBuilder();
b.addApiKey("123").addUser("", "").authenticate(false).documentation(false).host("localhost").port(12).webContext("/ok").withAuthentication().withAutorization().withDocumentation().withoutAuthentication().withoutAutorization().withoutDocumentation();
ApiConfig conf = b.build();
Assert.assertNotNull(conf);
new ApiConfigBuilder(new FF4j());
}
use of org.ff4j.FF4j in project ff4j by ff4j.
the class FF4jInitializationTest method testInitConstructor2.
@Test
public void testInitConstructor2() {
FF4j f2 = new FF4j();
f2.setAutocreate(true);
testingGeneratedFF4j(f2);
}
Aggregations