use of org.ff4j.strategy.PonderationStrategy in project ff4j by ff4j.
the class FeatureStoreTestSupport method testUpdateAddFlippingStrategy.
/**
* TDD.
*/
@Test
public void testUpdateAddFlippingStrategy() {
// Given
assertFf4j.assertThatFeatureExist(F2);
assertFf4j.assertThatFeatureDoesNotHaveFlippingStrategy(F2);
// When
Feature myFeature = ff4j.getFeatureStore().read(F2);
myFeature.setFlippingStrategy(new PonderationStrategy(0.1));
testedStore.update(myFeature);
// Then
assertFf4j.assertThatFeatureHasFlippingStrategy(F2);
}
use of org.ff4j.strategy.PonderationStrategy in project ff4j by ff4j.
the class InMemoryFeatureStoreTest method testUnitFeatureInitialization.
@Test
public void testUnitFeatureInitialization() {
InMemoryFeatureStore imfs = new InMemoryFeatureStore();
imfs.create(new Feature("default", true, "grp1", "desc", null, new PonderationStrategy()));
Assert.assertEquals(1, imfs.readAll().size());
}
use of org.ff4j.strategy.PonderationStrategy in project ff4j by ff4j.
the class CoreFeatureStoreTestSupport method testUpdateAddFlippingStrategy.
/**
* TDD.
*/
@Test
public void testUpdateAddFlippingStrategy() {
// Given
assertFf4j.assertThatFeatureExist(F2);
assertFf4j.assertThatFeatureDoesNotHaveFlippingStrategy(F2);
// When
Feature myFeature = ff4j.getFeatureStore().read(F2);
myFeature.setFlippingStrategy(new PonderationStrategy(0.1));
testedStore.update(myFeature);
// Then
assertFf4j.assertThatFeatureHasFlippingStrategy(F2);
}
use of org.ff4j.strategy.PonderationStrategy in project ff4j by ff4j.
the class CoreFeatureStoreTestSupport method testUpdateEditFlippingStrategy.
/**
* TDD.
*/
@Test
public void testUpdateEditFlippingStrategy() {
// Given
assertFf4j.assertThatFeatureExist(F3);
// When
Feature myFeature = ff4j.getFeatureStore().read(F3);
myFeature.setFlippingStrategy(new PonderationStrategy(0.1));
testedStore.update(myFeature);
// Then
assertFf4j.assertThatFeatureHasFlippingStrategy(F3);
}
use of org.ff4j.strategy.PonderationStrategy in project ff4j by ff4j.
the class CoreFeatureStoreTestSupport method testUpdateRemoveFlippingStrategy.
/**
* TDD.
*/
@Test
public void testUpdateRemoveFlippingStrategy() {
// Given
assertFf4j.assertThatFeatureExist(F3);
Feature myFeature = ff4j.getFeatureStore().read(F3);
myFeature.setFlippingStrategy(new PonderationStrategy(0.1));
testedStore.update(myFeature);
assertFf4j.assertThatFeatureHasFlippingStrategy(F3);
// When
Feature myFeature2 = ff4j.getFeatureStore().read(F3);
myFeature2.setFlippingStrategy(null);
testedStore.update(myFeature2);
// Then
assertFf4j.assertThatFeatureDoesNotHaveFlippingStrategy(F3);
}
Aggregations