Package org.lightadmin.api.config.unit

Examples of org.lightadmin.api.config.unit.ScopesConfigurationUnit


public class DefaultScopesConfigurationUnitBuilderTest {

    @Test
    public void defaultConfigurationUnitCreatedForDomainType() {
        ScopesConfigurationUnit configurationUnit = defaultScopesBuilder().build();

        assertEquals(DomainConfigurationUnitType.SCOPES, configurationUnit.getDomainConfigurationUnitType());
        assertEquals(DomainType.class, configurationUnit.getDomainType());

        assertScopesDefined(configurationUnit, "All");
    }
View Full Code Here


        assertScopesDefined(configurationUnit, "All");
    }

    @Test
    public void allScopesDefined() throws Exception {
        ScopesConfigurationUnit configurationUnit = defaultScopesBuilder()
                .scope("Scope #1", all())
                .scope("Scope #2", filter(DomainTypePredicates.alwaysTrue()))
                .build();

        assertScopesDefined(configurationUnit, "Scope #1", "Scope #2");
View Full Code Here

        assertScopesDefined(configurationUnit, "Scope #1", "Scope #2");
    }

    @Test
    public void defaultScopeSetByDefault() throws Exception {
        ScopesConfigurationUnit configurationUnit = defaultScopesBuilder()
                .scope("Scope #1", all())
                .scope("Scope #2", filter(DomainTypePredicates.alwaysTrue()))
                .build();

        assertTrue(configurationUnit.getScope("Scope #1").isDefaultScope());
    }
View Full Code Here

        assertTrue(configurationUnit.getScope("Scope #1").isDefaultScope());
    }

    @Test
    public void customSetDefaultScope() throws Exception {
        ScopesConfigurationUnit configurationUnit = defaultScopesBuilder()
                .scope("Scope #1", all())
                .scope("Scope #2", filter(DomainTypePredicates.alwaysTrue()).defaultScope(true))
                .build();

        assertTrue(configurationUnit.getScope("Scope #2").isDefaultScope());
    }
View Full Code Here

            }
        }
    }

    void validateScopes(final ConfigurationUnits configurationUnits, final ProblemReporter problemReporter) {
        final ScopesConfigurationUnit scopes = configurationUnits.getScopes();

        for (ScopeMetadata scope : scopes) {
            if (isPredicateScope(scope)) {
                validatePredicateScope(scope, configurationUnits, problemReporter);
            }
View Full Code Here

TOP

Related Classes of org.lightadmin.api.config.unit.ScopesConfigurationUnit

Copyright © 2018 www.massapicom. 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.