use of com.tngtech.archunit.library.Architectures.OnionArchitecture in project ArchUnit by TNG.
the class ArchitecturesTest method onion_architecture_rejects_empty_layers_if_layers_are_explicitly_not_optional_by_default.
@Test
public void onion_architecture_rejects_empty_layers_if_layers_are_explicitly_not_optional_by_default() {
OnionArchitecture architecture = anOnionArchitectureWithEmptyLayers().withOptionalLayers(false);
JavaClasses classes = new ClassFileImporter().importPackages(absolute("onionarchitecture"));
EvaluationResult result = architecture.evaluate(classes);
assertFailureOnionArchitectureWithEmptyLayers(result);
}
use of com.tngtech.archunit.library.Architectures.OnionArchitecture in project ArchUnit by TNG.
the class ArchitecturesTest method onion_architecture_description.
@Test
public void onion_architecture_description() {
OnionArchitecture architecture = onionArchitecture().domainModels("onionarchitecture.domain.model..").domainServices("onionarchitecture.domain.service..").applicationServices("onionarchitecture.application..").adapter("cli", "onionarchitecture.adapter.cli..").adapter("persistence", "onionarchitecture.adapter.persistence..").adapter("rest", "onionarchitecture.adapter.rest.command..", "onionarchitecture.adapter.rest.query..");
assertThat(architecture.getDescription()).isEqualTo("Onion architecture consisting of" + lineSeparator() + "domain models ('onionarchitecture.domain.model..')" + lineSeparator() + "domain services ('onionarchitecture.domain.service..')" + lineSeparator() + "application services ('onionarchitecture.application..')" + lineSeparator() + "adapter 'cli' ('onionarchitecture.adapter.cli..')" + lineSeparator() + "adapter 'persistence' ('onionarchitecture.adapter.persistence..')" + lineSeparator() + "adapter 'rest' ('onionarchitecture.adapter.rest.command..', 'onionarchitecture.adapter.rest.query..')");
}
use of com.tngtech.archunit.library.Architectures.OnionArchitecture in project ArchUnit by TNG.
the class ArchitecturesTest method onion_architecture_description_with_missing_layers.
@Test
public void onion_architecture_description_with_missing_layers() {
OnionArchitecture architecture = onionArchitecture();
assertThat(architecture.getDescription()).isEqualTo("Onion architecture consisting of");
}
Aggregations