use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class FF4jTest method createDeleteProperty.
@Test
public void createDeleteProperty() {
FF4j ff4j = new FF4j();
ff4j.createProperty(new PropertyString("p1", "v1"));
ff4j.audit();
ff4j.createProperty(new PropertyString("p2", "v2"));
Assert.assertTrue(ff4j.getPropertiesStore().existProperty("p1"));
ff4j.deleteProperty("p1");
Assert.assertFalse(ff4j.getPropertiesStore().existProperty("p1"));
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class FeatureTest method testAddPropertyWithNullCustomPropertiesIsOK.
@Test
public void testAddPropertyWithNullCustomPropertiesIsOK() {
// Given
Feature feat = new Feature("abc", true);
feat.setCustomProperties(null);
// When
feat.addProperty(new PropertyString("p1", "v1"));
// Then
Assert.assertTrue(feat.getCustomProperties().containsKey("p1"));
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class FeatureTest method testAddPropertyShouldAdd.
@Test
public void testAddPropertyShouldAdd() {
// Given
Feature feat = new Feature("abc", true);
Assert.assertFalse(feat.getCustomProperties().containsKey("p1"));
// When
feat.addProperty(new PropertyString("p1", "v1"));
// Then
Assert.assertTrue(feat.getCustomProperties().containsKey("p1"));
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class PropertyFactoryTest method testCreatePropertyOK.
@Test
public void testCreatePropertyOK() {
PropertyJsonBean jsonBean = new PropertyJsonBean(new PropertyString("p1", "v1"));
Assert.assertNotNull(PropertyFactory.createProperty(jsonBean));
}
use of org.ff4j.property.PropertyString in project ff4j by ff4j.
the class PropertyTest method tesInitPropertyString.
@Test
public void tesInitPropertyString() {
new PropertyString();
PropertyString p1 = new PropertyString("p1");
p1.setReadOnly(p1.isReadOnly());
PropertyString p2 = new PropertyString("p2", "EAST", Util.set("EAST", "WEST", "SOUTH", "NORTH"));
Assert.assertNotNull(p1.getName());
Assert.assertNotNull(p2.getFixedValues());
}
Aggregations