Search in sources :

Example 51 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class AuthorizationManagementTest method initFF4j.

/**
 * {@inheritDoc}
 */
@Override
public FF4j initFF4j() {
    FF4j ff4j = new FF4j();
    ff4j.setAuthorizationsManager(mockAuthManager);
    return ff4j;
}
Also used : FF4j(org.ff4j.FF4j)

Example 52 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class GenerationUtilTest method generationSource.

@Test
public void generationSource() throws IOException {
    // Given
    FF4j ff4j = new FF4j("ff4j.xml");
    Assert.assertNotNull(ff4j.getFeatureStore());
    Assert.assertNotNull(ff4j.getPropertiesStore());
    // When
    String data = GeneratorUtils.generateInterfaceConstantsSource(ff4j);
    // Then
    Assert.assertTrue(data.contains("FEATURE"));
    Assert.assertTrue(data.contains("interface"));
    Assert.assertNotNull(GeneratorUtils.exportInterfaceConstants(ff4j));
    GeneratorUtils.generateInterfaceConstantFile(ff4j, new File("./target"));
}
Also used : FF4j(org.ff4j.FF4j) File(java.io.File) Test(org.junit.Test)

Example 53 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FF4jInitializationTest method testInitConstructor3.

@Test
public void testInitConstructor3() {
    FF4j f3 = new FF4j();
    f3.setAuthorizationsManager(mock(AuthorizationsManager.class));
    f3.autoCreate(true);
    testingGeneratedFF4j(f3);
    Assert.assertNotNull(f3.getAuthorizationsManager());
}
Also used : FF4j(org.ff4j.FF4j) AuthorizationsManager(org.ff4j.security.AuthorizationsManager) Test(org.junit.Test)

Example 54 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FF4jInitializationTest method testInitConstructor1.

@Test
public void testInitConstructor1() {
    FF4j f1 = new FF4j();
    f1.setAutocreate(true);
    testingGeneratedFF4j(f1);
}
Also used : FF4j(org.ff4j.FF4j) Test(org.junit.Test)

Example 55 with FF4j

use of org.ff4j.FF4j in project ff4j by ff4j.

the class FF4jTest method testInitAuditProxy.

@Test
public void testInitAuditProxy() {
    FF4j ff4j = new FF4j();
    ff4j.setEnableAudit(true);
    ff4j.getFeatureStore();
    ff4j.setEnableAudit(false);
    ff4j.getFeatureStore();
}
Also used : FF4j(org.ff4j.FF4j) Test(org.junit.Test)

Aggregations

FF4j (org.ff4j.FF4j)60 Test (org.junit.Test)41 Before (org.junit.Before)9 Feature (org.ff4j.core.Feature)8 ArrayList (java.util.ArrayList)4 PropertyString (org.ff4j.property.PropertyString)4 InMemoryFeatureStore (org.ff4j.store.InMemoryFeatureStore)4 AssertFf4j (org.ff4j.test.AssertFf4j)4 InMemoryPropertyStore (org.ff4j.property.store.InMemoryPropertyStore)3 Date (java.util.Date)2 HashSet (java.util.HashSet)2 PropertyStoreAuditProxy (org.ff4j.audit.proxy.PropertyStoreAuditProxy)2 InMemoryCacheManager (org.ff4j.cache.InMemoryCacheManager)2 FeatureStore (org.ff4j.core.FeatureStore)2 PropertyDate (org.ff4j.property.PropertyDate)2 PropertyStore (org.ff4j.property.store.PropertyStore)2 SpringSecurityAuthorisationManager (org.ff4j.security.SpringSecurityAuthorisationManager)2 TestConstantsFF4j (org.ff4j.test.TestConstantsFF4j)2 ApiConfig (org.ff4j.web.ApiConfig)2 ApiConfigBuilder (org.ff4j.web.ApiConfigBuilder)2