From 5771b3689e62e294367effccf3e77e85cde8037c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Fuch=C3=9F?= Date: Sun, 3 Dec 2023 14:55:16 +0100 Subject: [PATCH] Add Architecture Test to ensure correct logging --- endtoend-testing/pom.xml | 6 ++++++ .../architecture/JPlagArchitectureTest.java | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 endtoend-testing/src/test/java/de/jplag/endtoend/architecture/JPlagArchitectureTest.java diff --git a/endtoend-testing/pom.xml b/endtoend-testing/pom.xml index a13a101fb..343135356 100644 --- a/endtoend-testing/pom.xml +++ b/endtoend-testing/pom.xml @@ -30,5 +30,11 @@ com.fasterxml.jackson.core jackson-databind + + com.tngtech.archunit + archunit-junit5 + 1.2.0 + test + diff --git a/endtoend-testing/src/test/java/de/jplag/endtoend/architecture/JPlagArchitectureTest.java b/endtoend-testing/src/test/java/de/jplag/endtoend/architecture/JPlagArchitectureTest.java new file mode 100644 index 000000000..9eeb8d107 --- /dev/null +++ b/endtoend-testing/src/test/java/de/jplag/endtoend/architecture/JPlagArchitectureTest.java @@ -0,0 +1,14 @@ +package de.jplag.endtoend.architecture; + +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; + +import com.tngtech.archunit.junit.AnalyzeClasses; +import com.tngtech.archunit.junit.ArchTest; +import com.tngtech.archunit.lang.ArchRule; + +@AnalyzeClasses(packages = "de.jplag") +public class JPlagArchitectureTest { + @ArchTest + public static final ArchRule enforceCorrectLogger = noClasses().should().accessClassesThat() + .haveNameMatching(java.util.logging.Logger.class.getName()); +}