DefaultScopesConfigurationUnitBuilder extends DomainTypeConfigurationUnitBuilder<ScopesConfigurationUnit> implements ScopesConfigurationUnitBuilder { @Override public ScopesConfigurationUnit build() { if (scopesMetadata.isEmpty()) { return new DefaultScopesConfigurationUnit(getDomainType(), newArrayList(ScopeMetadataUtils.all().defaultScope(true))); } setDefaultScopeIfNotDefined(); return new DefaultScopesConfigurationUnit(getDomainType(), scopesMetadata); } DefaultScopesConfigurationUnitBuilder(final Class<?> domainType); @Override ScopesConfigurationUnitBuilder scope(final String name, final ScopeMetadata scope); @Override ScopesConfigurationUnitBuilder scope(final ScopeMetadata scope); @Override ScopesConfigurationUnitBuilder defaultScope(); @Override ScopesConfigurationUnit build();  }
@Test public void defaultConfigurationUnitCreatedForDomainType() { ScopesConfigurationUnit configurationUnit = defaultScopesBuilder().build(); assertEquals(DomainConfigurationUnitType.SCOPES, configurationUnit.getDomainConfigurationUnitType()); assertEquals(DomainType.class, configurationUnit.getDomainType()); assertScopesDefined(configurationUnit, "All"); }