diff --git a/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentRepositoryArchitectureTest.java new file mode 100644 index 000000000000..8dd9f65e908f --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.assessment.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class AssessmentRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".assessment"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentResourceArchitectureTest.java new file mode 100644 index 000000000000..2fdabf0f0ba1 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.assessment.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class AssessmentResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".assessment"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentServiceArchitectureTest.java new file mode 100644 index 000000000000..2416f7230302 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/assessment/architecture/AssessmentServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.assessment.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class AssessmentServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".assessment"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaRepositoryArchitectureTest.java new file mode 100644 index 000000000000..cdfd6b6f5030 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.athena.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class AthenaRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".athena"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaResourceArchitectureTest.java new file mode 100644 index 000000000000..c1f38f97619c --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.athena.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class AthenaResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".athena"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaServiceArchitectureTest.java new file mode 100644 index 000000000000..7ecf7c9953b3 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/athena/architecture/AthenaServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.athena.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class AthenaServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".athena"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasRepositoryArchitectureTest.java new file mode 100644 index 000000000000..b2f7d4c4faee --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.atlas.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class AtlasRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".atlas"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasResourceArchitectureTest.java new file mode 100644 index 000000000000..2469bbb9ffd1 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.atlas.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class AtlasResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".atlas"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasServiceArchitectureTest.java new file mode 100644 index 000000000000..85f1f0e7f084 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.atlas.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class AtlasServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".atlas"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasTestArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasTestArchitectureTest.java index ae9fb5afc2cc..96bdd6b27d58 100644 --- a/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasTestArchitectureTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/atlas/architecture/AtlasTestArchitectureTest.java @@ -1,13 +1,13 @@ package de.tum.cit.aet.artemis.atlas.architecture; import de.tum.cit.aet.artemis.atlas.AbstractAtlasIntegrationTest; -import de.tum.cit.aet.artemis.shared.architecture.AbstractModuleTestArchitectureTest; +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleTestArchitectureTest; class AtlasTestArchitectureTest extends AbstractModuleTestArchitectureTest { @Override - protected String getModulePackageName() { - return "atlas"; + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".atlas"; } @Override diff --git a/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentRepositoryArchitectureTest.java new file mode 100644 index 000000000000..29294ffdeddf --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.buildagent.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class BuildAgentRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".buildagent"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentResourceArchitectureTest.java new file mode 100644 index 000000000000..937d9abcb386 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.buildagent.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class BuildAgentResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".buildagent"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentServiceArchitectureTest.java new file mode 100644 index 000000000000..2e577accf146 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.buildagent.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class BuildAgentServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".buildagent"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/communication/ChannelIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/communication/ChannelIntegrationTest.java index 80fb86f7e167..c0aa140ae963 100644 --- a/src/test/java/de/tum/cit/aet/artemis/communication/ChannelIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/communication/ChannelIntegrationTest.java @@ -35,8 +35,8 @@ import de.tum.cit.aet.artemis.text.domain.TextExercise; import de.tum.cit.aet.artemis.text.util.TextExerciseUtilService; import de.tum.cit.aet.artemis.tutorialgroup.service.TutorialGroupChannelManagementService; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupTestRepository; -import de.tum.cit.aet.artemis.tutorialgroups.util.TutorialGroupUtilService; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.util.TutorialGroupUtilService; class ChannelIntegrationTest extends AbstractConversationTest { diff --git a/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationRepositoryArchitectureTest.java new file mode 100644 index 000000000000..819247fc09dd --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.communication.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class CommunicationRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".communication"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationResourceArchitectureTest.java new file mode 100644 index 000000000000..4711c8f827d2 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.communication.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class CommunicationResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".communication"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationServiceArchitectureTest.java new file mode 100644 index 000000000000..9b7f383c7d49 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/communication/architecture/CommunicationServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.communication.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class CommunicationServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".communication"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/communication/notifications/service/TutorialGroupNotificationServiceTest.java b/src/test/java/de/tum/cit/aet/artemis/communication/notifications/service/TutorialGroupNotificationServiceTest.java index fb484c37a99d..23ad94f5a00f 100644 --- a/src/test/java/de/tum/cit/aet/artemis/communication/notifications/service/TutorialGroupNotificationServiceTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/communication/notifications/service/TutorialGroupNotificationServiceTest.java @@ -40,8 +40,8 @@ import de.tum.cit.aet.artemis.tutorialgroup.domain.TutorialGroupRegistration; import de.tum.cit.aet.artemis.tutorialgroup.domain.TutorialGroupRegistrationType; import de.tum.cit.aet.artemis.tutorialgroup.repository.TutorialGroupNotificationRepository; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupRegistrationTestRepository; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupRegistrationTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupTestRepository; class TutorialGroupNotificationServiceTest extends AbstractSpringIntegrationIndependentTest { diff --git a/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreRepositoryArchitectureTest.java new file mode 100644 index 000000000000..62b81e022085 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.core.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class CoreRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".core"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreResourceArchitectureTest.java new file mode 100644 index 000000000000..50c63c5cc8fe --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.core.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class CoreResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".core"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreServiceArchitectureTest.java new file mode 100644 index 000000000000..9761e37f3df5 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.core.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class CoreServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".core"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/core/authentication/InternalAuthenticationIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/core/authentication/InternalAuthenticationIntegrationTest.java index 84ba3d693707..7ade409a5287 100644 --- a/src/test/java/de/tum/cit/aet/artemis/core/authentication/InternalAuthenticationIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/core/authentication/InternalAuthenticationIntegrationTest.java @@ -41,7 +41,7 @@ import de.tum.cit.aet.artemis.programming.test_repository.ProgrammingExerciseTestRepository; import de.tum.cit.aet.artemis.programming.util.ProgrammingExerciseUtilService; import de.tum.cit.aet.artemis.shared.base.AbstractSpringIntegrationJenkinsGitlabTest; -import de.tum.cit.aet.artemis.tutorialgroups.util.TutorialGroupUtilService; +import de.tum.cit.aet.artemis.tutorialgroup.util.TutorialGroupUtilService; class InternalAuthenticationIntegrationTest extends AbstractSpringIntegrationJenkinsGitlabTest { diff --git a/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamRepositoryArchitectureTest.java new file mode 100644 index 000000000000..b860e2b71ecf --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamRepositoryArchitectureTest.java @@ -0,0 +1,19 @@ +package de.tum.cit.aet.artemis.exam.architecture; + +import java.util.Set; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class ExamRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".exam"; + } + + // TODO: This method should be removed once all repositories are tested + @Override + protected Set testTransactionalExclusions() { + return Set.of("de.tum.cit.aet.artemis.exam.service.StudentExamService.generateMissingStudentExams(de.tum.cit.aet.artemis.exam.domain.Exam)", + "de.tum.cit.aet.artemis.exam.service.StudentExamService.generateStudentExams(de.tum.cit.aet.artemis.exam.domain.Exam)"); + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamResourceArchitectureTest.java new file mode 100644 index 000000000000..e4bd14ec6e00 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.exam.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class ExamResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".exam"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamServiceArchitectureTest.java new file mode 100644 index 000000000000..f58c5b418e55 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/exam/architecture/ExamServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.exam.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class ExamServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".exam"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseRepositoryArchitectureTest.java new file mode 100644 index 000000000000..a8217f01ddd8 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.exercise.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class ExerciseRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".exercise"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseResourceArchitectureTest.java new file mode 100644 index 000000000000..4bf283ed3743 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.exercise.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class ExerciseResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".exercise"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseServiceArchitectureTest.java new file mode 100644 index 000000000000..82f413701a44 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/exercise/architecture/ExerciseServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.exercise.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class ExerciseServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".exercise"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadRepositoryArchitectureTest.java new file mode 100644 index 000000000000..58d076ffc236 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.fileupload.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class FileUploadRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".fileupload"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadResourceArchitectureTest.java new file mode 100644 index 000000000000..f9840c68c99a --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.fileupload.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class FileUploadResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".fileupload"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadServiceArchitectureTest.java new file mode 100644 index 000000000000..9f5286c323aa --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/fileupload/architecture/FileUploadServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.fileupload.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class FileUploadServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".fileupload"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisRepositoryArchitectureTest.java new file mode 100644 index 000000000000..14e84bf6132a --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.iris.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class IrisRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".iris"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisResourceArchitectureTest.java new file mode 100644 index 000000000000..6fd24efe1676 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.iris.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class IrisResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".iris"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisServiceArchitectureTest.java new file mode 100644 index 000000000000..fd4fd819618e --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/iris/architecture/IrisServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.iris.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class IrisServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".iris"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureRepositoryArchitectureTest.java new file mode 100644 index 000000000000..44822b7ce77a --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureRepositoryArchitectureTest.java @@ -0,0 +1,19 @@ +package de.tum.cit.aet.artemis.lecture.architecture; + +import java.util.Set; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class LectureRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".lecture"; + } + + // TODO: This method should be removed once all repositories are tested + @Override + protected Set testTransactionalExclusions() { + return Set.of( + "de.tum.cit.aet.artemis.lecture.service.LectureImportService.importLecture(de.tum.cit.aet.artemis.lecture.domain.Lecture, de.tum.cit.aet.artemis.core.domain.Course, boolean)"); + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureResourceArchitectureTest.java new file mode 100644 index 000000000000..60c18b0c859a --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.lecture.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class LectureResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".lecture"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureServiceArchitectureTest.java new file mode 100644 index 000000000000..9a95336a0014 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/lecture/architecture/LectureServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.lecture.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class LectureServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".lecture"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiRepositoryArchitectureTest.java new file mode 100644 index 000000000000..ee39f5bea551 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.lti.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class LtiRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".lti"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiResourceArchitectureTest.java new file mode 100644 index 000000000000..424d98b40240 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.lti.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class LtiResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".lti"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiServiceArchitectureTest.java new file mode 100644 index 000000000000..a8851799c808 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.lti.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class LtiServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".lti"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiTestArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiTestArchitectureTest.java index 5ff2636ad04f..ceb15210ada3 100644 --- a/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiTestArchitectureTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/lti/architecture/LtiTestArchitectureTest.java @@ -1,13 +1,13 @@ package de.tum.cit.aet.artemis.lti.architecture; import de.tum.cit.aet.artemis.lti.AbstractLtiIntegrationTest; -import de.tum.cit.aet.artemis.shared.architecture.AbstractModuleTestArchitectureTest; +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleTestArchitectureTest; class LtiTestArchitectureTest extends AbstractModuleTestArchitectureTest { @Override - protected String getModulePackageName() { - return "lti"; + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".lti"; } @Override diff --git a/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingRepositoryArchitectureTest.java new file mode 100644 index 000000000000..b4521cef376f --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.modeling.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class ModelingRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".modeling"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingResourceArchitectureTest.java new file mode 100644 index 000000000000..b04c2bd7cffe --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.modeling.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class ModelingResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".modeling"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingServiceArchitectureTest.java new file mode 100644 index 000000000000..51c955064864 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/modeling/architecture/ModelingServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.modeling.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class ModelingServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".modeling"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismRepositoryArchitectureTest.java new file mode 100644 index 000000000000..8de1d5770b6a --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.plagiarism.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class PlagiarismRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".plagiarism"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismResourceArchitectureTest.java new file mode 100644 index 000000000000..2011aeb12af9 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.plagiarism.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class PlagiarismResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".plagiarism"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismServiceArchitectureTest.java new file mode 100644 index 000000000000..92dddeb24e65 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/plagiarism/architecture/PlagiarismServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.plagiarism.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class PlagiarismServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".plagiarism"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingRepositoryArchitectureTest.java new file mode 100644 index 000000000000..0a84a5b32363 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingRepositoryArchitectureTest.java @@ -0,0 +1,19 @@ +package de.tum.cit.aet.artemis.programming.architecture; + +import java.util.Set; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class ProgrammingRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".programming"; + } + + // TODO: This method should be removed once all repositories are tested + @Override + protected Set testTransactionalExclusions() { + return Set.of( + "de.tum.cit.aet.artemis.programming.service.ProgrammingExerciseImportBasicService.importProgrammingExerciseBasis(de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise, de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise)"); + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingResourceArchitectureTest.java new file mode 100644 index 000000000000..35bb64028401 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.programming.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class ProgrammingResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".programming"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingServiceArchitectureTest.java new file mode 100644 index 000000000000..0076830b06a1 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/programming/architecture/ProgrammingServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.programming.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class ProgrammingServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".programming"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizRepositoryArchitectureTest.java new file mode 100644 index 000000000000..83c9e1785cc2 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.quiz.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class QuizRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".quiz"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizResourceArchitectureTest.java new file mode 100644 index 000000000000..03b7b63d4ef2 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.quiz.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class QuizResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".quiz"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizServiceArchitectureTest.java new file mode 100644 index 000000000000..cde158ac9ec2 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/quiz/architecture/QuizServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.quiz.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class QuizServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".quiz"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/shared/TestRepositoryConfiguration.java b/src/test/java/de/tum/cit/aet/artemis/shared/TestRepositoryConfiguration.java index c5a605642d8e..8b3bfbaebfb0 100644 --- a/src/test/java/de/tum/cit/aet/artemis/shared/TestRepositoryConfiguration.java +++ b/src/test/java/de/tum/cit/aet/artemis/shared/TestRepositoryConfiguration.java @@ -20,7 +20,7 @@ "de.tum.cit.aet.artemis.communication.test_repository", "de.tum.cit.aet.artemis.core.test_repository", "de.tum.cit.aet.artemis.exam.test_repository", "de.tum.cit.aet.artemis.exercise.test_repository", "de.tum.cit.aet.artemis.lecture.test_repository", "de.tum.cit.aet.artemis.lti.test_repository", "de.tum.cit.aet.artemis.modeling.test_repository", "de.tum.cit.aet.artemis.programming.test_repository", "de.tum.cit.aet.artemis.quiz.test_repository", - "de.tum.cit.aet.artemis.text.test_repository", "de.tum.cit.aet.artemis.tutorialgroups.test_repository" }, repositoryBaseClass = RepositoryImpl.class) + "de.tum.cit.aet.artemis.text.test_repository", "de.tum.cit.aet.artemis.tutorialgroup.test_repository" }, repositoryBaseClass = RepositoryImpl.class) @EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") @EnableTransactionManagement public class TestRepositoryConfiguration { diff --git a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ArchitectureTest.java index 424f5e68b6ac..2cbd4da31b86 100644 --- a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ArchitectureTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ArchitectureTest.java @@ -81,13 +81,6 @@ /** * This class contains architecture tests that apply for the whole project. - *

- * For more specific tests please refer to the other architecture test classes: - *

    - *
  • {@link RepositoryArchitectureTest}
  • - *
  • {@link ServiceArchitectureTest}
  • - *
  • {@link ResourceArchitectureTest}
  • - *
*/ class ArchitectureTest extends AbstractArchitectureTest { @@ -108,7 +101,7 @@ void testClassNameAndVisibility() { .areAnnotatedWith(BeforeAll.class).or().areAnnotatedWith(AfterEach.class).or().areAnnotatedWith(AfterAll.class).should().bePublic(); classNames.check(testClasses); - noPublicTestClasses.check(testClasses.that(are(not(simpleNameContaining("Abstract"))))); + noPublicTestClasses.check(testClasses.that(are(not(or(simpleNameContaining("Abstract"), INTERFACES))))); noPublicTests.check(testClasses); } @@ -308,7 +301,7 @@ public void check(JavaClass item, ConditionEvents events) { @Test void testNoRestControllersImported() { final var exceptions = new String[] { "AccountResourceIntegrationTest", "AndroidAppSiteAssociationResourceTest", "AppleAppSiteAssociationResourceTest", - "ResourceArchitectureTest" }; + "AbstractModuleResourceArchitectureTest" }; final var classes = classesExcept(allClasses, exceptions); classes().should(IMPORT_RESTCONTROLLER).check(classes); } diff --git a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/RepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleRepositoryArchitectureTest.java similarity index 65% rename from src/test/java/de/tum/cit/aet/artemis/shared/architecture/RepositoryArchitectureTest.java rename to src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleRepositoryArchitectureTest.java index 91355aa292ca..6e3887654163 100644 --- a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/RepositoryArchitectureTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleRepositoryArchitectureTest.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.shared.architecture; +package de.tum.cit.aet.artemis.shared.architecture.module; import static com.tngtech.archunit.base.DescribedPredicate.and; import static com.tngtech.archunit.core.domain.JavaClass.Predicates.INTERFACES; @@ -7,10 +7,6 @@ import static com.tngtech.archunit.core.domain.properties.HasType.Predicates.rawType; import static com.tngtech.archunit.lang.SimpleConditionEvent.violated; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; -import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.methods; -import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; -import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noMethods; -import static org.assertj.core.api.Assertions.assertThat; import java.util.Optional; import java.util.Set; @@ -40,30 +36,31 @@ import de.tum.cit.aet.artemis.core.repository.base.ArtemisJpaRepository; import de.tum.cit.aet.artemis.core.repository.base.RepositoryImpl; +import de.tum.cit.aet.artemis.shared.architecture.AbstractArchitectureTest; -/** - * This class contains architecture tests for the persistence layer. - */ -class RepositoryArchitectureTest extends AbstractArchitectureTest { +public abstract class AbstractModuleRepositoryArchitectureTest extends AbstractArchitectureTest implements ModuleArchitectureTest { @Test void shouldBeNamedRepository() { - ArchRule rule = classes().that().areAnnotatedWith(Repository.class).should().haveSimpleNameEndingWith("Repository") + ArchRule rule = classesOfThisModuleThat().areAnnotatedWith(Repository.class).should().haveSimpleNameEndingWith("Repository") .because("repositories should have a name ending with 'Repository'."); - rule.check(productionClasses); + // allow empty should since some modules do not have repositories + rule.allowEmptyShould(true).check(allClasses); } @Test void shouldBeInRepositoryPackage() { - ArchRule rule = classes().that().areAnnotatedWith(Repository.class).should().resideInAPackage("..repository..") + ArchRule rule = classesOfThisModuleThat().areAnnotatedWith(Repository.class).should().resideInAPackage("..repository..") .because("repositories should be in the package 'repository'."); - rule.check(productionClasses); + // allow empty should since some modules do not have repositories + rule.allowEmptyShould(true).check(productionClasses); } @Test void testJPQLStyle() { - var queryRule = methods().that().areAnnotatedWith(Query.class).should(USE_UPPER_CASE_SQL_STYLE).because("@Query content should follow the style guide"); - queryRule.check(allClasses); + var queryRule = methodsOfThisModuleThat().areAnnotatedWith(Query.class).should(USE_UPPER_CASE_SQL_STYLE).because("@Query content should follow the style guide"); + // allow empty should since some modules do not have any @Query methods + queryRule.allowEmptyShould(true).check(allClasses); } // See https://openjpa.apache.org/builds/1.2.3/apache-openjpa/docs/jpa_langref.html#jpa_langref_from_identifiers @@ -95,7 +92,7 @@ public void check(JavaMethod item, ConditionEvents events) { @Test void testNoUnusedRepositoryMethods() { - ArchRule unusedMethods = noMethods().that().areDeclaredInClassesThat().areInterfaces().and().areDeclaredInClassesThat().areAnnotatedWith(Repository.class) + ArchRule unusedMethods = noMethodsOfThisModuleThat().areDeclaredInClassesThat().areInterfaces().and().areDeclaredInClassesThat().areAnnotatedWith(Repository.class) .should(new ArchCondition<>("not be referenced") { @Override @@ -106,49 +103,60 @@ public void check(JavaMethod javaMethod, ConditionEvents conditionEvents) { } } }).because("unused methods should be removed from repositories to keep a clean code base."); - unusedMethods.check(allClasses); + // allow empty should since some modules do not have repositories + unusedMethods.allowEmptyShould(true).check(allClasses); } @Test void testNoEntityGraphsOnQueries() { - ArchRule noEntityGraphsOnQueries = noMethods().that().areAnnotatedWith(Query.class).and().areDeclaredInClassesThat().areInterfaces().and().areDeclaredInClassesThat() - .areAnnotatedWith(Repository.class).should().beAnnotatedWith(EntityGraph.class) + ArchRule noEntityGraphsOnQueries = noMethodsOfThisModuleThat().areAnnotatedWith(Query.class).and().areDeclaredInClassesThat().areInterfaces().and() + .areDeclaredInClassesThat().areAnnotatedWith(Repository.class).should().beAnnotatedWith(EntityGraph.class) .because("Spring Boot 3 ignores EntityGraphs on JPQL queries. You need to integrate a JOIN FETCH into the query."); - noEntityGraphsOnQueries.check(productionClasses); + // allow empty should since some modules do not have any @Query methods + noEntityGraphsOnQueries.allowEmptyShould(true).check(productionClasses); } @Test void testRepositoryParamAnnotation() { - var useParamInQueries = methods().that().areAnnotatedWith(Query.class).should(haveAllParametersAnnotatedWithUnless(rawType(Param.class), type(Pageable.class))); - var notUseParamOutsideQueries = methods().that().areNotAnnotatedWith(Query.class).should(notHaveAnyParameterAnnotatedWith(rawType(Param.class))); - useParamInQueries.check(productionClasses); - notUseParamOutsideQueries.check(productionClasses); + var useParamInQueries = methodsOfThisModuleThat().areAnnotatedWith(Query.class).should(haveAllParametersAnnotatedWithUnless(rawType(Param.class), type(Pageable.class))); + var notUseParamOutsideQueries = methodsOfThisModuleThat().areNotAnnotatedWith(Query.class).should(notHaveAnyParameterAnnotatedWith(rawType(Param.class))); + // allow empty should since some modules do not have any @Query methods + useParamInQueries.allowEmptyShould(true).check(productionClasses); + notUseParamOutsideQueries.allowEmptyShould(true).check(productionClasses); } @Test void persistenceShouldNotAccessServices() { - noClasses().that().areAnnotatedWith(Repository.class).should().accessClassesThat().areAnnotatedWith(Service.class).check(allClasses); + // allow empty should since some modules do not have repositories + noClassesOfThisModuleThat().areAnnotatedWith(Repository.class).should().accessClassesThat().areAnnotatedWith(Service.class).allowEmptyShould(true).check(allClasses); + } + + // TODO: This method should be removed once all repositories are tested + protected Set testTransactionalExclusions() { + return Set.of(); } @Test void testTransactional() { var classesPredicated = and(INTERFACES, annotatedWith(Repository.class)); - var transactionalRule = methods().that().areAnnotatedWith(simpleNameAnnotation("Transactional")).should().beDeclaredInClassesThat(classesPredicated); - - // TODO: In the future we should reduce this number and eventually replace it by transactionalRule.check(allClasses) - // The following methods currently violate this rule: - // Method - // Method - // Method - // Method - // Method - var result = transactionalRule.evaluate(allClasses); - assertThat(result.getFailureReport().getDetails()).hasSize(5); + var transactionalRule = methodsOfThisModuleThat().areAnnotatedWith(simpleNameAnnotation("Transactional")).should().beDeclaredInClassesThat(classesPredicated) + .orShould(new ArchCondition<>("methods excluded from this rule") { + + @Override + public void check(JavaMethod javaMethod, ConditionEvents events) { + if (!testTransactionalExclusions().contains(javaMethod.getFullName())) { + events.add(violated(javaMethod, "Method %s should not be annotated with @Transactional".formatted(javaMethod.getFullName()))); + } + } + }); + + // allow empty should since some modules do not have any @Transactional methods + transactionalRule.allowEmptyShould(true).check(allClasses); } @Test void testOnlySpringTransactionalAnnotation() { - ArchRule onlySpringTransactionalAnnotation = noMethods().should().beAnnotatedWith(javax.transaction.Transactional.class).orShould() + ArchRule onlySpringTransactionalAnnotation = noMethodsOfThisModule().should().beAnnotatedWith(javax.transaction.Transactional.class).orShould() .beAnnotatedWith(jakarta.transaction.Transactional.class) .because("Only Spring's Transactional annotation should be used as the usage of the other two is not reliable."); onlySpringTransactionalAnnotation.check(allClasses); @@ -156,20 +164,26 @@ void testOnlySpringTransactionalAnnotation() { @Test void repositoriesImplementArtemisJpaRepository() { - classes().that().areAssignableTo(JpaRepository.class).and().doNotBelongToAnyOf(RepositoryImpl.class).should().beAssignableTo(ArtemisJpaRepository.class).check(allClasses); + // allow empty should since some modules do not have repositories + classesOfThisModuleThat().areAssignableTo(JpaRepository.class).and().doNotBelongToAnyOf(RepositoryImpl.class).should().beAssignableTo(ArtemisJpaRepository.class) + .allowEmptyShould(true).check(allClasses); } @Test void orElseThrowShouldNotBeCalled() { - noClasses().that().areAssignableTo(ArtemisJpaRepository.class).should().callMethod(Optional.class, "orElseThrow").orShould() - .callMethod(Optional.class, "orElseThrow", Supplier.class).because("ArtemisJpaRepository offers the method getValueElseThrow for this use case").check(allClasses); + // allow empty should since some modules do not have any repositories + noClassesOfThisModuleThat().areAssignableTo(ArtemisJpaRepository.class).should().callMethod(Optional.class, "orElseThrow").orShould() + .callMethod(Optional.class, "orElseThrow", Supplier.class).because("ArtemisJpaRepository offers the method getValueElseThrow for this use case") + .allowEmptyShould(true).check(allClasses); } @Test void usedInProductionCode() { var excludedMethods = Set.of("de.tum.cit.aet.artemis.core.repository.CustomAuditEventRepository.find(java.lang.String, java.time.Instant, java.lang.String)"); - methods().that().areDeclaredInClassesThat().areAnnotatedWith(Repository.class).and().areDeclaredInClassesThat(new DescribedPredicate<>("") { + + // allow empty should since some modules do not have repositories + methodsOfThisModuleThat().areDeclaredInClassesThat().areAnnotatedWith(Repository.class).and().areDeclaredInClassesThat(new DescribedPredicate<>("") { @Override public boolean test(JavaClass javaClass) { @@ -189,25 +203,56 @@ public void check(JavaMethod javaMethod, ConditionEvents conditionEvents) { conditionEvents.add(SimpleConditionEvent.violated(javaMethod, "Method " + javaMethod.getFullName() + " is not used in production code")); } } - }).because("methods that are not used in production code should be moved to test repositories").check(allClasses); + }).because("methods that are not used in production code should be moved to test repositories").allowEmptyShould(true).check(allClasses); } @Test void enforcePrimaryBeanAnnotationOnTestRepositories() { - classes().that().resideInAPackage("..test_repository..").should().beAnnotatedWith(Primary.class) - .because("Test repositories should be annotated with @Primary to override the production repository beans").check(testClasses); + // allow empty should since some modules do not have repositories + classesOfThisModuleThat().resideInAPackage("..test_repository..").should().beAnnotatedWith(Primary.class) + .because("Test repositories should be annotated with @Primary to override the production repository beans").allowEmptyShould(true).check(testClasses); } @Test void enforceUsageOfTestRepository() { - classes().should(notUseRepositoriesWithSubclasses()).because("Test Repositories should be used over production repositories, if such a repository exist.") + classesOfThisModule().should(notUseRepositoriesWithSubclasses()).because("Test Repositories should be used over production repositories, if such a repository exist.") .check(testClasses); } + private ArchCondition notUseRepositoriesWithSubclasses() { + return new ArchCondition<>("not use repositories with subclasses") { + + @Override + public void check(JavaClass testClass, ConditionEvents events) { + for (JavaField field : testClass.getAllFields()) { + JavaType fieldType = field.getRawType(); + + if (isRepository(fieldType)) { + JavaClass repositoryClass = fieldType.toErasure(); + + if (!repositoryClass.getSubclasses().isEmpty()) { + String message = String.format("Test class %s uses repository %s which has subclasses: %s", testClass.getName(), repositoryClass.getName(), + repositoryClass.getSubclasses()); + events.add(SimpleConditionEvent.violated(testClass, message)); + } + } + } + } + + private boolean isRepository(JavaType javaType) { + JavaClass javaClass = javaType.toErasure(); + // Check if the type is a repository by seeing if it implements JpaRepository + return javaClass.isAssignableTo(JpaRepository.class); + // Alternatively, if your repositories are in a specific package, you can use: + // return javaClass.getPackageName().startsWith("com.yourapp.repositories"); + } + }; + } + @Test void enforceStructureOfTestRepositories() { var excludedRepositories = Set.of("de.tum.cit.aet.artemis.lti.test_repository.OnlineCourseConfigurationTestRepository"); // OnlineCourseConfigurationTestRepository does not - // have an accompanying production repository + // have an accompanying production repository classes().that().resideInAPackage("..test_repository..").should().beInterfaces().andShould().beAssignableTo(JpaRepository.class) .andShould(new ArchCondition<>("extend a repository from production code with matching name excluding last 'Test'") { @@ -231,7 +276,14 @@ public void check(JavaClass javaClass, ConditionEvents events) { }).check(testClasses); } - // Utility method to replace the last occurrence of a substring + /** + * Utility method to replace the last occurrence of a substring. + * + * @param string The string to replace the substring in. + * @param substring The substring to replace. + * @param replacement The replacement for the substring. + * @return The string with the last occurrence of the substring replaced. + */ private String replaceLast(String string, String substring, String replacement) { int lastIndex = string.lastIndexOf(substring); if (lastIndex == -1) { @@ -241,34 +293,4 @@ private String replaceLast(String string, String substring, String replacement) sb.replace(lastIndex, lastIndex + substring.length(), replacement); return sb.toString(); } - - private ArchCondition notUseRepositoriesWithSubclasses() { - return new ArchCondition<>("not use repositories with subclasses") { - - @Override - public void check(JavaClass testClass, ConditionEvents events) { - for (JavaField field : testClass.getAllFields()) { - JavaType fieldType = field.getRawType(); - - if (isRepository(fieldType)) { - JavaClass repositoryClass = fieldType.toErasure(); - - if (!repositoryClass.getSubclasses().isEmpty()) { - String message = String.format("Test class %s uses repository %s which has subclasses: %s", testClass.getName(), repositoryClass.getName(), - repositoryClass.getSubclasses()); - events.add(SimpleConditionEvent.violated(testClass, message)); - } - } - } - } - - private boolean isRepository(JavaType javaType) { - JavaClass javaClass = javaType.toErasure(); - // Check if the type is a repository by seeing if it implements JpaRepository - return javaClass.isAssignableTo(JpaRepository.class); - // Alternatively, if your repositories are in a specific package, you can use: - // return javaClass.getPackageName().startsWith("com.yourapp.repositories"); - } - }; - } } diff --git a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleResourceArchitectureTest.java similarity index 81% rename from src/test/java/de/tum/cit/aet/artemis/shared/architecture/ResourceArchitectureTest.java rename to src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleResourceArchitectureTest.java index 92ee8cd91c61..b90faedcaabf 100644 --- a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ResourceArchitectureTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleResourceArchitectureTest.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.shared.architecture; +package de.tum.cit.aet.artemis.shared.architecture.module; import static com.tngtech.archunit.lang.ConditionEvent.createMessage; import static com.tngtech.archunit.lang.SimpleConditionEvent.violated; @@ -32,33 +32,38 @@ import com.tngtech.archunit.lang.ConditionEvents; import de.tum.cit.aet.artemis.communication.web.LinkPreviewResource; +import de.tum.cit.aet.artemis.shared.architecture.AbstractArchitectureTest; -class ResourceArchitectureTest extends AbstractArchitectureTest { +public abstract class AbstractModuleResourceArchitectureTest extends AbstractArchitectureTest implements ModuleArchitectureTest { private static final Pattern KEBAB_CASE_PATH_PATTERN = Pattern.compile("^(\\.?[a-z0-9]+(-[a-z0-9]+)*|\\{[^}]+})(/(([a-z0-9]+(-[a-z0-9]+)*|\\{[^}]+})))*(\\.json|/\\*)?$"); @Test void shouldBeNamedResource() { - ArchRule rule = classes().that().areAnnotatedWith(RestController.class).should().haveSimpleNameEndingWith("Resource") + ArchRule rule = classesOfThisModuleThat().areAnnotatedWith(RestController.class).should().haveSimpleNameEndingWith("Resource") .because("resources should have a name ending with 'Resource'."); - rule.check(productionClasses); + + // allow empty should since some modules do not have any REST controllers + rule.allowEmptyShould(true).check(productionClasses); } @Test void shouldBeInResourcePackage() { - ArchRule rule = classes().that().areAnnotatedWith(RestController.class).should().resideInAPackage("..web..").because("resources should be in the package 'rest'."); - rule.check(productionClasses); + ArchRule rule = classesOfThisModuleThat().areAnnotatedWith(RestController.class).should().resideInAPackage("..web..").because("resources should be in the package 'web'."); + // allow empty should since some modules do not have any REST controllers + rule.allowEmptyShould(true).check(productionClasses); } @Test void allPublicMethodsShouldReturnResponseEntity() { // TODO: We want to move away from ModelAndView. Once all occurrences are removed, this test needs to be adjusted. // REST controller methods should return ResponseEntity ("normal" endpoints) or ModelAndView (for redirects) - ArchRule rule = methods().that().areDeclaredInClassesThat().areAnnotatedWith(RestController.class).and().arePublic().should().haveRawReturnType(ResponseEntity.class) - .orShould().haveRawReturnType(ModelAndView.class); + ArchRule rule = methodsOfThisModuleThat().areDeclaredInClassesThat().areAnnotatedWith(RestController.class).and().arePublic().should() + .haveRawReturnType(ResponseEntity.class).orShould().haveRawReturnType(ModelAndView.class); // We exclude the LinkPreviewResource from this check, as it is a special case that requires the serialization of the response which is not possible with ResponseEntities JavaClasses classes = classesExcept(allClasses, LinkPreviewResource.class); - rule.check(classes); + // allow empty should since some modules do not have any REST controllers + rule.allowEmptyShould(true).check(classes); } private static final Set> annotationClasses = Set.of(GetMapping.class, PatchMapping.class, PostMapping.class, PutMapping.class, DeleteMapping.class, @@ -66,7 +71,8 @@ void allPublicMethodsShouldReturnResponseEntity() { @Test void shouldCorrectlyUseRequestMappingAnnotations() { - classes().that().areAnnotatedWith(RequestMapping.class).should(haveCorrectRequestMappingPathForClasses()).check(productionClasses); + // allow empty should since some modules do not have any REST controllers + classesOfThisModuleThat().areAnnotatedWith(RequestMapping.class).should(haveCorrectRequestMappingPathForClasses()).allowEmptyShould(true).check(productionClasses); for (var annotation : annotationClasses) { methods().that().areAnnotatedWith(annotation).should(haveCorrectRequestMappingPathForMethods(annotation)).allowEmptyShould(true).check(productionClasses); } diff --git a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleServiceArchitectureTest.java similarity index 62% rename from src/test/java/de/tum/cit/aet/artemis/shared/architecture/ServiceArchitectureTest.java rename to src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleServiceArchitectureTest.java index 32d955cc8a32..cd43dd981e51 100644 --- a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/ServiceArchitectureTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleServiceArchitectureTest.java @@ -1,11 +1,9 @@ -package de.tum.cit.aet.artemis.shared.architecture; +package de.tum.cit.aet.artemis.shared.architecture.module; import static com.tngtech.archunit.core.domain.JavaModifier.ABSTRACT; import static com.tngtech.archunit.core.domain.JavaModifier.FINAL; import static com.tngtech.archunit.lang.SimpleConditionEvent.violated; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; -import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.methods; -import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; import org.junit.jupiter.api.Test; import org.springframework.scheduling.annotation.Async; @@ -26,18 +24,20 @@ import de.tum.cit.aet.artemis.lti.service.OAuth2JWKSService; import de.tum.cit.aet.artemis.programming.service.localci.LocalCIWebsocketMessagingService; import de.tum.cit.aet.artemis.programming.web.GitDiffReportParserService; +import de.tum.cit.aet.artemis.shared.architecture.AbstractArchitectureTest; -class ServiceArchitectureTest extends AbstractArchitectureTest { +public abstract class AbstractModuleServiceArchitectureTest extends AbstractArchitectureTest implements ModuleArchitectureTest { @Test void shouldBeNamedService() { - ArchRule rule = classes().that().areAnnotatedWith(Service.class).should().haveSimpleNameEndingWith("Service").because("services should have a name ending with 'Service'."); + ArchRule rule = classesOfThisModuleThat().areAnnotatedWith(Service.class).should().haveSimpleNameEndingWith("Service") + .because("services should have a name ending with 'Service'."); rule.check(productionClasses); } @Test void shouldBeInServicePackage() { - ArchRule rule = classes().that().areAnnotatedWith(Service.class).should().resideInAPackage("..service..").because("services should be in the package 'service'."); + ArchRule rule = classesOfThisModuleThat().areAnnotatedWith(Service.class).should().resideInAPackage("..service..").because("services should be in the package 'service'."); final var exceptions = new Class[] { MigrationService.class, SecurityMetersService.class, DomainUserDetailsService.class, OAuth2JWKSService.class, JWTCookieService.class, GitDiffReportParserService.class, ResultWebsocketService.class, LocalCIWebsocketMessagingService.class }; final var classes = classesExcept(productionClasses, exceptions); @@ -46,30 +46,30 @@ void shouldBeInServicePackage() { @Test void testNoWrongServiceImports() { - ArchRule rule = noClasses().should().dependOnClassesThat().resideInAnyPackage("org.jvnet.hk2.annotations") + ArchRule rule = noClassesOfThisModule().should().dependOnClassesThat().resideInAnyPackage("org.jvnet.hk2.annotations") .because("this is the wrong service class, use org.springframework.stereotype.Service."); rule.check(allClasses); } @Test void testCorrectServiceAnnotation() { - classes().that().resideInAPackage("de.tum.cit.aet.artemis.*.service..").and().haveSimpleNameEndingWith("Service").and().areNotInterfaces().and().doNotHaveModifier(ABSTRACT) - .should().beAnnotatedWith(org.springframework.stereotype.Service.class) + classesOfThisModuleThat().resideInAPackage("de.tum.cit.aet.artemis.*.service..").and().haveSimpleNameEndingWith("Service").and().areNotInterfaces().and() + .doNotHaveModifier(ABSTRACT).should().beAnnotatedWith(org.springframework.stereotype.Service.class) .because("services should be consistently managed by Spring's dependency injection container.").check(allClasses); - classes().that().haveSimpleNameEndingWith("Service").should().notBeAnnotatedWith(Component.class).check(allClasses); - classes().that().haveSimpleNameEndingWith("Service").should().notBeAnnotatedWith(RestController.class).check(allClasses); - classes().that().haveSimpleNameEndingWith("Service").should().notHaveModifier(FINAL).check(allClasses); + classesOfThisModuleThat().haveSimpleNameEndingWith("Service").should().notBeAnnotatedWith(Component.class).check(allClasses); + classesOfThisModuleThat().haveSimpleNameEndingWith("Service").should().notBeAnnotatedWith(RestController.class).check(allClasses); + classesOfThisModuleThat().haveSimpleNameEndingWith("Service").should().notHaveModifier(FINAL).check(allClasses); - classes().that().areAnnotatedWith(Service.class).should().haveSimpleNameEndingWith("Service").check(allClasses); - classes().that().areAnnotatedWith(Service.class).should().notBeAnnotatedWith(Component.class).check(allClasses); - classes().that().areAnnotatedWith(Service.class).should().notBeAnnotatedWith(RestController.class).check(allClasses); - classes().that().areAnnotatedWith(Service.class).should().notHaveModifier(FINAL).check(allClasses); + classesOfThisModuleThat().areAnnotatedWith(Service.class).should().haveSimpleNameEndingWith("Service").check(allClasses); + classesOfThisModuleThat().areAnnotatedWith(Service.class).should().notBeAnnotatedWith(Component.class).check(allClasses); + classesOfThisModuleThat().areAnnotatedWith(Service.class).should().notBeAnnotatedWith(RestController.class).check(allClasses); + classesOfThisModuleThat().areAnnotatedWith(Service.class).should().notHaveModifier(FINAL).check(allClasses); } @Test void testCorrectAsyncCalls() { - var noCallsFromOwnClass = methods().that().areAnnotatedWith(Async.class).should(new ArchCondition<>("not be called within the same class") { + var noCallsFromOwnClass = methodsOfThisModuleThat().areAnnotatedWith(Async.class).should(new ArchCondition<>("not be called within the same class") { @Override public void check(JavaMethod javaMethod, ConditionEvents conditionEvents) { @@ -85,6 +85,8 @@ public void check(JavaMethod javaMethod, ConditionEvents conditionEvents) { } }).because("Methods annotated with @Async are meant to be executed in a new thread." + " The thread gets created in a Spring proxy subclass and requires the method to only be called from the outside."); - noCallsFromOwnClass.check(productionClasses); + + // allow empty should since some modules do not have any @Async methods + noCallsFromOwnClass.allowEmptyShould(true).check(productionClasses); } } diff --git a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleTestArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleTestArchitectureTest.java new file mode 100644 index 000000000000..66da61a07636 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleTestArchitectureTest.java @@ -0,0 +1,26 @@ +package de.tum.cit.aet.artemis.shared.architecture.module; + +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noMembers; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import de.tum.cit.aet.artemis.shared.architecture.AbstractArchitectureTest; + +public abstract class AbstractModuleTestArchitectureTest extends AbstractArchitectureTest implements ModuleArchitectureTest { + + abstract protected Class getAbstractModuleIntegrationTestClass(); + + @Test + void integrationTestsShouldExtendAbstractModuleIntegrationTest() { + classesOfThisModuleThat().haveSimpleNameEndingWith("IntegrationTest").should().beAssignableTo(getAbstractModuleIntegrationTestClass()) + .because("All integration tests should extend %s".formatted(getAbstractModuleIntegrationTestClass())).check(testClasses); + } + + @Test + void integrationTestsShouldNotAutowireMembers() { + noMembers().that().areAnnotatedWith(Autowired.class).should().beDeclaredInClassesThat().areAssignableTo(getAbstractModuleIntegrationTestClass()).andShould() + .notBeDeclaredIn(getAbstractModuleIntegrationTestClass()) + .because("Integration tests should not autowire members in any class that inherits from %s".formatted(getAbstractModuleIntegrationTestClass())).check(testClasses); + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/ModuleArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/ModuleArchitectureTest.java new file mode 100644 index 000000000000..817e47c7932e --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/ModuleArchitectureTest.java @@ -0,0 +1,52 @@ +package de.tum.cit.aet.artemis.shared.architecture.module; + +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.methods; +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; +import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noMethods; + +import com.tngtech.archunit.lang.syntax.elements.ClassesThat; +import com.tngtech.archunit.lang.syntax.elements.GivenClassesConjunction; +import com.tngtech.archunit.lang.syntax.elements.GivenMethodsConjunction; +import com.tngtech.archunit.lang.syntax.elements.MethodsThat; + +public interface ModuleArchitectureTest { + + String getModulePackage(); + + default String getModuleWithSubpackage() { + return getModulePackage() + ".."; + } + + default GivenClassesConjunction classesOfThisModule() { + return classes().that().resideInAPackage(getModuleWithSubpackage()); + } + + default ClassesThat classesOfThisModuleThat() { + return classesOfThisModule().and(); + } + + default GivenClassesConjunction noClassesOfThisModule() { + return noClasses().that().resideInAPackage(getModuleWithSubpackage()); + } + + default ClassesThat noClassesOfThisModuleThat() { + return noClassesOfThisModule().and(); + } + + default GivenMethodsConjunction methodsOfThisModule() { + return methods().that().areDeclaredInClassesThat().resideInAPackage(getModuleWithSubpackage()); + } + + default MethodsThat methodsOfThisModuleThat() { + return methodsOfThisModule().and(); + } + + default GivenMethodsConjunction noMethodsOfThisModule() { + return noMethods().that().areDeclaredInClassesThat().resideInAPackage(getModuleWithSubpackage()); + } + + default MethodsThat noMethodsOfThisModuleThat() { + return noMethodsOfThisModule().and(); + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextRepositoryArchitectureTest.java new file mode 100644 index 000000000000..61dc3973c989 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextRepositoryArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.text.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class TextRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".text"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextResourceArchitectureTest.java new file mode 100644 index 000000000000..71380481099c --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.text.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class TextResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".text"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextServbiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextServbiceArchitectureTest.java new file mode 100644 index 000000000000..d8bb2db8d3fa --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/text/architecture/TextServbiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.text.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class TextServbiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".text"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/AbstractTutorialGroupIntegrationTest.java similarity index 97% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/AbstractTutorialGroupIntegrationTest.java index fb830564f00b..e18ea9081084 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/AbstractTutorialGroupIntegrationTest.java @@ -1,6 +1,6 @@ -package de.tum.cit.aet.artemis.tutorialgroups; +package de.tum.cit.aet.artemis.tutorialgroup; -import static de.tum.cit.aet.artemis.tutorialgroups.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; +import static de.tum.cit.aet.artemis.tutorialgroup.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; import static org.assertj.core.api.Assertions.assertThat; import java.time.LocalDate; @@ -44,10 +44,10 @@ import de.tum.cit.aet.artemis.tutorialgroup.repository.TutorialGroupsConfigurationRepository; import de.tum.cit.aet.artemis.tutorialgroup.service.TutorialGroupChannelManagementService; import de.tum.cit.aet.artemis.tutorialgroup.service.TutorialGroupService; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupRegistrationTestRepository; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupScheduleTestRepository; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupTestRepository; -import de.tum.cit.aet.artemis.tutorialgroups.util.TutorialGroupUtilService; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupRegistrationTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupScheduleTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.util.TutorialGroupUtilService; /** * Contains useful methods for testing the tutorial groups feature. diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupFreePeriodIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupFreePeriodIntegrationTest.java similarity index 99% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupFreePeriodIntegrationTest.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupFreePeriodIntegrationTest.java index 5b750a73f558..d4ba9018ca62 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupFreePeriodIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupFreePeriodIntegrationTest.java @@ -1,6 +1,6 @@ -package de.tum.cit.aet.artemis.tutorialgroups; +package de.tum.cit.aet.artemis.tutorialgroup; -import static de.tum.cit.aet.artemis.tutorialgroups.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; +import static de.tum.cit.aet.artemis.tutorialgroup.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; import static org.assertj.core.api.Assertions.assertThat; import java.time.LocalDateTime; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupIntegrationTest.java similarity index 99% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupIntegrationTest.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupIntegrationTest.java index b08e710cd1a5..00e2cf588148 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupIntegrationTest.java @@ -1,7 +1,7 @@ -package de.tum.cit.aet.artemis.tutorialgroups; +package de.tum.cit.aet.artemis.tutorialgroup; +import static de.tum.cit.aet.artemis.tutorialgroup.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; import static de.tum.cit.aet.artemis.tutorialgroup.domain.TutorialGroupRegistrationType.INSTRUCTOR_REGISTRATION; -import static de.tum.cit.aet.artemis.tutorialgroups.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupScheduleIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupScheduleIntegrationTest.java similarity index 99% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupScheduleIntegrationTest.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupScheduleIntegrationTest.java index 6b0ab4262754..da47e6647d01 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupScheduleIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupScheduleIntegrationTest.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.tutorialgroups; +package de.tum.cit.aet.artemis.tutorialgroup; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupSessionIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupSessionIntegrationTest.java similarity index 99% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupSessionIntegrationTest.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupSessionIntegrationTest.java index 83b9087bd6a8..54fbfb9ad627 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupSessionIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupSessionIntegrationTest.java @@ -1,6 +1,6 @@ -package de.tum.cit.aet.artemis.tutorialgroups; +package de.tum.cit.aet.artemis.tutorialgroup; -import static de.tum.cit.aet.artemis.tutorialgroups.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; +import static de.tum.cit.aet.artemis.tutorialgroup.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; import static org.assertj.core.api.Assertions.assertThat; import java.time.LocalDate; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupsConfigurationIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupsConfigurationIntegrationTest.java similarity index 98% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupsConfigurationIntegrationTest.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupsConfigurationIntegrationTest.java index dd7b8801006f..0dda38b7f7c6 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/TutorialGroupsConfigurationIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/TutorialGroupsConfigurationIntegrationTest.java @@ -1,6 +1,6 @@ -package de.tum.cit.aet.artemis.tutorialgroups; +package de.tum.cit.aet.artemis.tutorialgroup; -import static de.tum.cit.aet.artemis.tutorialgroups.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; +import static de.tum.cit.aet.artemis.tutorialgroup.AbstractTutorialGroupIntegrationTest.RandomTutorialGroupGenerator.generateRandomTitle; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupRepositoryArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupRepositoryArchitectureTest.java new file mode 100644 index 000000000000..96cc99fc6eae --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupRepositoryArchitectureTest.java @@ -0,0 +1,18 @@ +package de.tum.cit.aet.artemis.tutorialgroup.architecture; + +import java.util.Set; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleRepositoryArchitectureTest; + +class TutorialGroupRepositoryArchitectureTest extends AbstractModuleRepositoryArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".tutorialgroup"; + } + + // TODO: This method should be removed once all repositories are tested + @Override + protected Set testTransactionalExclusions() { + return Set.of("de.tum.cit.aet.artemis.tutorialgroup.service.TutorialGroupsConfigurationService.onTimeZoneUpdate(de.tum.cit.aet.artemis.core.domain.Course)"); + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupResourceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupResourceArchitectureTest.java new file mode 100644 index 000000000000..14a70d887215 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupResourceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.tutorialgroup.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleResourceArchitectureTest; + +class TutorialGroupResourceArchitectureTest extends AbstractModuleResourceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".tutorialgroup"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupServiceArchitectureTest.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupServiceArchitectureTest.java new file mode 100644 index 000000000000..94843d026888 --- /dev/null +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/architecture/TutorialGroupServiceArchitectureTest.java @@ -0,0 +1,10 @@ +package de.tum.cit.aet.artemis.tutorialgroup.architecture; + +import de.tum.cit.aet.artemis.shared.architecture.module.AbstractModuleServiceArchitectureTest; + +class TutorialGroupServiceArchitectureTest extends AbstractModuleServiceArchitectureTest { + + public String getModulePackage() { + return ARTEMIS_PACKAGE + ".tutorialgroup"; + } +} diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupRegistrationTestRepository.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupRegistrationTestRepository.java similarity index 94% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupRegistrationTestRepository.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupRegistrationTestRepository.java index 4b91c014ae70..d6ac29e112ee 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupRegistrationTestRepository.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupRegistrationTestRepository.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.tutorialgroups.test_repository; +package de.tum.cit.aet.artemis.tutorialgroup.test_repository; import jakarta.validation.constraints.NotNull; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupScheduleTestRepository.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupScheduleTestRepository.java similarity index 88% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupScheduleTestRepository.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupScheduleTestRepository.java index 9571f28a2c4b..bd2b8472b306 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupScheduleTestRepository.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupScheduleTestRepository.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.tutorialgroups.test_repository; +package de.tum.cit.aet.artemis.tutorialgroup.test_repository; import java.util.Optional; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupTestRepository.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupTestRepository.java similarity index 94% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupTestRepository.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupTestRepository.java index 75383acde76d..779dc5023571 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/test_repository/TutorialGroupTestRepository.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/test_repository/TutorialGroupTestRepository.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.tutorialgroups.test_repository; +package de.tum.cit.aet.artemis.tutorialgroup.test_repository; import java.util.Optional; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/util/TutorialGroupFactory.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/util/TutorialGroupFactory.java similarity index 97% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/util/TutorialGroupFactory.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/util/TutorialGroupFactory.java index 1ed5b6beeb7b..2b054c08dc81 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/util/TutorialGroupFactory.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/util/TutorialGroupFactory.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.tutorialgroups.util; +package de.tum.cit.aet.artemis.tutorialgroup.util; import java.time.LocalDate; import java.time.format.DateTimeFormatter; diff --git a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/util/TutorialGroupUtilService.java b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/util/TutorialGroupUtilService.java similarity index 97% rename from src/test/java/de/tum/cit/aet/artemis/tutorialgroups/util/TutorialGroupUtilService.java rename to src/test/java/de/tum/cit/aet/artemis/tutorialgroup/util/TutorialGroupUtilService.java index 621f53a19be3..0f75088ebd5b 100644 --- a/src/test/java/de/tum/cit/aet/artemis/tutorialgroups/util/TutorialGroupUtilService.java +++ b/src/test/java/de/tum/cit/aet/artemis/tutorialgroup/util/TutorialGroupUtilService.java @@ -1,4 +1,4 @@ -package de.tum.cit.aet.artemis.tutorialgroups.util; +package de.tum.cit.aet.artemis.tutorialgroup.util; import static de.tum.cit.aet.artemis.core.util.DateUtil.interpretInTimeZone; import static org.assertj.core.api.Assertions.assertThat; @@ -28,8 +28,8 @@ import de.tum.cit.aet.artemis.tutorialgroup.repository.TutorialGroupFreePeriodRepository; import de.tum.cit.aet.artemis.tutorialgroup.repository.TutorialGroupSessionRepository; import de.tum.cit.aet.artemis.tutorialgroup.repository.TutorialGroupsConfigurationRepository; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupRegistrationTestRepository; -import de.tum.cit.aet.artemis.tutorialgroups.test_repository.TutorialGroupTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupRegistrationTestRepository; +import de.tum.cit.aet.artemis.tutorialgroup.test_repository.TutorialGroupTestRepository; /** * Service responsible for initializing the database with specific testdata related to tutorial groups for use in integration tests.