Fix Architecture tests in LayeredArchitectureTest
This commit is contained in:
@ -23,11 +23,6 @@ import java.util.List;
|
|||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
public class Gruppen2Application {
|
public class Gruppen2Application {
|
||||||
@Autowired
|
|
||||||
private GroupService groupService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private EventService eventService;
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Gruppen2Application.class, args);
|
SpringApplication.run(Gruppen2Application.class, args);
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package mops.gruppen2.architecture;
|
package mops.gruppen2.architecture;
|
||||||
|
|
||||||
import com.tngtech.archunit.core.importer.ImportOption;
|
import com.tngtech.archunit.core.importer.ImportOption;
|
||||||
import com.tngtech.archunit.junit.AnalyzeClasses;
|
import com.tngtech.archunit.junit.AnalyzeClasses;
|
||||||
import com.tngtech.archunit.junit.ArchTest;
|
import com.tngtech.archunit.junit.ArchTest;
|
||||||
import com.tngtech.archunit.lang.ArchRule;
|
import com.tngtech.archunit.lang.ArchRule;
|
||||||
import com.tngtech.archunit.library.Architectures;
|
import com.tngtech.archunit.library.Architectures;
|
||||||
|
|
||||||
@AnalyzeClasses(packages = "mops.gruppen2", importOptions = { ImportOption.DoNotIncludeTests.class })
|
@AnalyzeClasses(packages = "mops.gruppen2", importOptions = { ImportOption.DoNotIncludeTests.class })
|
||||||
public class LayeredArchitectureTest {
|
public class LayeredArchitectureTest {
|
||||||
@ -14,17 +14,18 @@ public class LayeredArchitectureTest {
|
|||||||
.layer("Domain").definedBy("..domain..")
|
.layer("Domain").definedBy("..domain..")
|
||||||
.layer("Service").definedBy("..service")
|
.layer("Service").definedBy("..service")
|
||||||
.layer("Controller").definedBy("..controller..")
|
.layer("Controller").definedBy("..controller..")
|
||||||
.layer("Repository").definedBy("..repository..");
|
.layer("Repository").definedBy("..repository..")
|
||||||
|
.layer("Config").definedBy("..config..");
|
||||||
|
|
||||||
@ArchTest
|
@ArchTest
|
||||||
public static final ArchRule domainLayerShouldOnlyBeAccessedByServiceAndControllerLayer = layeredArchitecture
|
public static final ArchRule domainLayerShouldOnlyBeAccessedByServiceAndControllerLayer = layeredArchitecture
|
||||||
.whereLayer("Domain")
|
.whereLayer("Domain")
|
||||||
.mayOnlyBeAccessedByLayers("Service", "Controller");
|
.mayOnlyBeAccessedByLayers("Service", "Controller", "Config");
|
||||||
|
|
||||||
@ArchTest
|
@ArchTest
|
||||||
public static final ArchRule serviceLayerShouldOnlyBeAccessedByControllerLayer = layeredArchitecture
|
public static final ArchRule serviceLayerShouldOnlyBeAccessedByControllerLayer = layeredArchitecture
|
||||||
.whereLayer("Service")
|
.whereLayer("Service")
|
||||||
.mayOnlyBeAccessedByLayers("Controller");
|
.mayOnlyBeAccessedByLayers("Controller", "Config");
|
||||||
|
|
||||||
@ArchTest
|
@ArchTest
|
||||||
public static final ArchRule repositoryLayerShouldOnlyBeAccessedByServiceLayer = layeredArchitecture
|
public static final ArchRule repositoryLayerShouldOnlyBeAccessedByServiceLayer = layeredArchitecture
|
||||||
|
|||||||
Reference in New Issue
Block a user