use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.
the class PropertyStoreTestSupport method readOKFixed.
@Test
public void readOKFixed() {
// Given
testedStore.createProperty(new PropertyLogLevel(READ_OK_FIXED, LogLevel.ERROR));
// When
Property<?> log = testedStore.readProperty(READ_OK_FIXED);
// Then
Assert.assertNotNull(log);
Assert.assertNotNull(log.getName());
Assert.assertEquals(READ_OK_FIXED, log.getName());
Assert.assertEquals(LogLevel.ERROR, log.getValue());
Assert.assertEquals("ERROR", log.asString());
Assert.assertNotNull(log.getFixedValues());
}
use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.
the class PropertyStoreTestSupport method updateKOInvalidValue.
/**
* TDD.
*/
@Test(expected = IllegalArgumentException.class)
public void updateKOInvalidValue() {
// Given
testedStore.createProperty(new PropertyLogLevel("updateKOInvalidValue", LogLevel.ERROR));
// When
testedStore.updateProperty("updateKOInvalidValue", "KO");
}
use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.
the class PropertyStoreTestSupport method updateOKProperties.
/**
* TDD.
*/
@Test
public void updateOKProperties() {
// Given
testedStore.createProperty(new PropertyLogLevel("logX", LogLevel.ERROR));
// When
PropertyLogLevel pll = new PropertyLogLevel("logX", LogLevel.INFO);
testedStore.updateProperty(pll);
// Then
Assert.assertEquals(LogLevel.INFO, testedStore.readProperty("logX").getValue());
}
use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.
the class PropertyStoreTestSupport method updateOK.
/**
* TDD.
*/
@Test
public void updateOK() {
// Given
testedStore.createProperty(new PropertyLogLevel(UPDATE_OK, LogLevel.ERROR));
// When
testedStore.updateProperty(UPDATE_OK, "INFO");
// Then
Assert.assertEquals(LogLevel.INFO, testedStore.readProperty(UPDATE_OK).getValue());
}
use of org.ff4j.property.PropertyLogLevel in project ff4j by ff4j.
the class PropertyStoreTestSupport method addPropertyKOAlreadyExist.
/**
* TDD.
*/
@Test(expected = PropertyAlreadyExistException.class)
public void addPropertyKOAlreadyExist() {
// Given
testedStore.createProperty(new PropertyLogLevel("log", LogLevel.DEBUG));
Assert.assertTrue(testedStore.existProperty("log"));
// When
testedStore.createProperty(new PropertyLogLevel("log", LogLevel.DEBUG));
// Then expect to fail
}
Aggregations