Examples of FeatureState


Examples of org.togglz.core.repository.FeatureState

    @Test
    public void shouldReturnFalseForInvalidJavaScript() {

        ScriptEngineActivationStrategy strategy = new ScriptEngineActivationStrategy();

        FeatureState state = aScriptState(JAVASCRIPT, INVALID_JAVASCRIPT);
        boolean active = strategy.isActive(state, aFeatureUser("john"));

        assertThat(active).isFalse();

    }
View Full Code Here

Examples of org.togglz.core.repository.FeatureState

    @Test
    public void shouldReturnSameResultAsScriptForLiterals() {

        ScriptEngineActivationStrategy strategy = new ScriptEngineActivationStrategy();

        FeatureState stateAlwaysTrue = aScriptState(JAVASCRIPT, "1 == 1");
        assertThat(strategy.isActive(stateAlwaysTrue, aFeatureUser("john"))).isTrue();

        FeatureState stateAlwaysFalse = aScriptState(JAVASCRIPT, "0 == 1");
        assertThat(strategy.isActive(stateAlwaysFalse, aFeatureUser("john"))).isFalse();

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.