From e260fcce75358f928bec7d7390118190c36013db Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 30 Jun 2023 09:10:34 +0200 Subject: [PATCH 01/60] Enable parallel Unit Testing --- ...tractSpringIntegrationBambooBitbucketJiraTest.java | 3 +++ ...stractSpringIntegrationGitlabCIGitlabSamlTest.java | 3 +++ .../AbstractSpringIntegrationJenkinsGitlabTest.java | 3 +++ .../AbstractSpringIntegrationLocalCILocalVCTest.java | 3 +++ src/test/resources/junit-platform.properties | 11 ++++++++--- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java index d2d8649f796e..41918764b046 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java @@ -17,6 +17,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -59,6 +61,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.SAME_THREAD) @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "bamboo", "bitbucket", "jira", "ldap", "scheduling", "athene", "apollon" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java index b7042fff70c4..e7422a9eaa6e 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java @@ -14,6 +14,8 @@ import org.gitlab4j.api.models.PipelineStatus; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -45,6 +47,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.SAME_THREAD) @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "gitlabci", "gitlab", "saml2", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java index dab173709102..920079adbc05 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java @@ -14,6 +14,8 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -41,6 +43,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.SAME_THREAD) @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "gitlab", "jenkins", "athene", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java index bc50910ccc37..d9db5cc0f22b 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java @@ -12,6 +12,8 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -54,6 +56,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.SAME_THREAD) @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "localci", "localvc", "scheduling" }) diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties index 0c274a5d1f0b..fa5d68923362 100644 --- a/src/test/resources/junit-platform.properties +++ b/src/test/resources/junit-platform.properties @@ -1,3 +1,8 @@ -#junit.jupiter.execution.parallel.enabled = true -#junit.jupiter.execution.parallel.mode.default = concurrent -#junit.jupiter.execution.parallel.mode.classes.default = same_thread +# Enables junit5 parallel test execution. Tests are run on one JVM instance. +junit.jupiter.execution.parallel.enabled = true + +# Parallel execution of test classes. +junit.jupiter.execution.parallel.mode.default = concurrent + +# Parallel execution of methods within test classes. +junit.jupiter.execution.parallel.mode.classes.default = concurrent From 110af5b9995f5ca089a9ac4b2ee33c94c57e4402 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 30 Jun 2023 12:34:17 +0200 Subject: [PATCH 02/60] Add systemProperties to build.gradle --- build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.gradle b/build.gradle index 35ebfd2f86c2..df820e1caa9d 100644 --- a/build.gradle +++ b/build.gradle @@ -97,6 +97,16 @@ modernizer { test { useJUnitPlatform() + systemProperties([ + // Enables junit5 parallel test execution. Tests are run on one JVM instance. + 'junit.jupiter.execution.parallel.enabled': 'true', + + // Parallel execution of test classes. + 'junit.jupiter.execution.parallel.mode.default': 'concurrent', + + // Parallel execution of methods within test classes. + 'junit.jupiter.execution.parallel.mode.classes.default': 'concurrent', + ]) exclude "**/*IT*", "**/*IntTest*" testLogging { events "FAILED", "SKIPPED" From 3eb31e8278a6698a09aed1f7051ee12fafba9ee0 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 3 Jul 2023 14:12:55 +0200 Subject: [PATCH 03/60] Try to parallelise Integration Tests --- build.gradle | 10 ---------- ...stractSpringIntegrationBambooBitbucketJiraTest.java | 5 ++--- ...bstractSpringIntegrationGitlabCIGitlabSamlTest.java | 5 ++--- .../AbstractSpringIntegrationJenkinsGitlabTest.java | 5 ++--- .../AbstractSpringIntegrationLocalCILocalVCTest.java | 5 ++--- .../tum/in/www1/artemis/course/CourseTestService.java | 4 ++-- .../notification/NotificationTargetFactoryTest.java | 3 +++ 7 files changed, 13 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index 291cf016c58d..5fdf6ebff5e9 100644 --- a/build.gradle +++ b/build.gradle @@ -99,16 +99,6 @@ modernizer { test { useJUnitPlatform() - systemProperties([ - // Enables junit5 parallel test execution. Tests are run on one JVM instance. - 'junit.jupiter.execution.parallel.enabled': 'true', - - // Parallel execution of test classes. - 'junit.jupiter.execution.parallel.mode.default': 'concurrent', - - // Parallel execution of methods within test classes. - 'junit.jupiter.execution.parallel.mode.classes.default': 'concurrent', - ]) exclude "**/*IT*", "**/*IntTest*" testLogging { events "FAILED", "SKIPPED" diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java index 41918764b046..eba52aef570c 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java @@ -17,8 +17,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; +import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -61,7 +60,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@Execution(ExecutionMode.SAME_THREAD) +@ResourceLock(value = "AbstractSpringIntegrationBambooBitbucketJiraTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "bamboo", "bitbucket", "jira", "ldap", "scheduling", "athene", "apollon" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java index e7422a9eaa6e..bcffcffb7d02 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java @@ -14,8 +14,7 @@ import org.gitlab4j.api.models.PipelineStatus; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; +import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -47,7 +46,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@Execution(ExecutionMode.SAME_THREAD) +@ResourceLock(value = "AbstractSpringIntegrationGitlabCIGitlabSamlTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "gitlabci", "gitlab", "saml2", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java index 920079adbc05..dd54bd4c0423 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java @@ -14,8 +14,7 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; +import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -43,7 +42,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@Execution(ExecutionMode.SAME_THREAD) +@ResourceLock(value = "AbstractSpringIntegrationJenkinsGitlabTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "gitlab", "jenkins", "athene", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java index d9db5cc0f22b..0540c3b861ce 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java @@ -12,8 +12,7 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; +import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -56,7 +55,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@Execution(ExecutionMode.SAME_THREAD) +@ResourceLock(value = "AbstractSpringIntegrationLocalCILocalVCTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "localci", "localvc", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java index 0e348794c4ab..c7d1b505de4e 100644 --- a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java +++ b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java @@ -1548,8 +1548,8 @@ public void testEnrollInCourse() throws Exception { assertThat(updatedStudent.getGroups()).as("User is enrolled in course").contains(course1.getStudentGroupName()); List auditEvents = auditEventRepo.find("ab12cde", Instant.now().minusSeconds(20), Constants.ENROLL_IN_COURSE); - assertThat(auditEvents).as("Audit Event for course enrollment added").hasSize(1); - AuditEvent auditEvent = auditEvents.get(0); + AuditEvent auditEvent = auditEvents.stream().max(Comparator.comparing(AuditEvent::getTimestamp)).orElse(null); + assertThat(auditEvent).as("Audit Event for course enrollment added").isNotNull(); assertThat(auditEvent.getData()).as("Correct Event Data").containsEntry("course", course1.getTitle()); request.postWithResponseBody("/api/courses/" + course2.getId() + "/enroll", null, User.class, HttpStatus.FORBIDDEN); diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java index dc3d6630a870..d4bea5711cdd 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java @@ -6,6 +6,8 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.metis.Post; @@ -13,6 +15,7 @@ import de.tum.in.www1.artemis.domain.notification.Notification; import de.tum.in.www1.artemis.domain.notification.NotificationTarget; +@Execution(ExecutionMode.SAME_THREAD) class NotificationTargetFactoryTest { private static Post post; From 3dc5368f2ee6cfc5bfc0b0bf86de889734ff9c66 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 10 Jul 2023 17:11:38 +0200 Subject: [PATCH 04/60] Added new SpringBootTest Note: Since this change affects the test execution order, some tests might fail. I commit this for asserting that the tests actually run (fail) faster with parallel execution enabled on bamboo and github actions. The tests will be fixed in another commit --- .../artemis/AbstractArchitectureTest.java | 2 +- .../AbstractSpringIntegrationTest.java | 287 ++++++++++++++++++ .../in/www1/artemis/ClientForwardTest.java | 2 +- .../ContentVersionIntegrationTest.java | 2 +- .../www1/artemis/DatabaseQueryCountTest.java | 2 +- .../in/www1/artemis/FileIntegrationTest.java | 2 +- .../GuidedTourSettingResourceTest.java | 2 +- .../ImprintResourceIntegrationTest.java | 3 +- .../artemis/LogResourceIntegrationTest.java | 2 +- .../LongFeedbackResourceIntegrationTest.java | 2 +- .../artemis/Lti13LaunchIntegrationTest.java | 2 +- .../artemis/OAuth2JWKSIntegrationTest.java | 2 +- ...ivacyStatementResourceIntegrationTest.java | 2 +- .../artemis/StatisticsIntegrationTest.java | 2 +- .../AssessmentComplaintIntegrationTest.java | 4 +- ...ssessmentTeamComplaintIntegrationTest.java | 4 +- .../ComplaintResponseIntegrationTest.java | 4 +- .../ExampleSubmissionIntegrationTest.java | 4 +- .../ExerciseScoresChartIntegrationTest.java | 4 +- .../assessment/GradeStepIntegrationTest.java | 4 +- .../GradingScaleIntegrationTest.java | 4 +- .../ParticipantScoreIntegrationTest.java | 4 +- .../RatingResourceIntegrationTest.java | 4 +- .../TutorEffortIntegrationTest.java | 4 +- ...utorLeaderboardServiceIntegrationTest.java | 4 +- .../TutorParticipationIntegrationTest.java | 4 +- ...rParticipationResourceIntegrationTest.java | 4 +- .../artemis/bonus/BonusIntegrationTest.java | 4 +- .../TopicSubscriptionInterceptorTest.java | 4 +- .../in/www1/artemis/domain/ExerciseTest.java | 4 +- .../in/www1/artemis/domain/ResultTest.java | 4 +- .../ResultListenerIntegrationTest.java | 4 +- .../exam/ExamActivityIntegrationTest.java | 4 +- .../exam/ExamSessionIntegrationTest.java | 4 +- .../exercise/ExerciseIntegrationTest.java | 4 +- .../FileUploadAssessmentIntegrationTest.java | 4 +- .../FileUploadExerciseIntegrationTest.java | 4 +- .../FileUploadSubmissionIntegrationTest.java | 4 +- ...ApollonDiagramResourceIntegrationTest.java | 4 +- .../ModelingAssessmentIntegrationTest.java | 4 +- .../ModelingExerciseIntegrationTest.java | 4 +- .../ModelingSubmissionIntegrationTest.java | 4 +- .../programmingexercise/GitServiceTest.java | 4 +- .../PlantUmlIntegrationTest.java | 4 +- .../ProgrammingAssessmentIntegrationTest.java | 4 +- ...ProgrammingExerciseGitIntegrationTest.java | 4 +- ...gExerciseParticipationIntegrationTest.java | 4 +- ...grammingExerciseRepositoryServiceTest.java | 4 +- .../ProgrammingExerciseServiceTest.java | 4 +- .../QuizExerciseIntegrationTest.java | 4 +- .../QuizSubmissionIntegrationTest.java | 4 +- .../hestia/CodeHintIntegrationTest.java | 4 +- .../artemis/hestia/CodeHintServiceTest.java | 4 +- .../hestia/ExerciseHintIntegrationTest.java | 4 +- .../hestia/ExerciseHintServiceTest.java | 4 +- .../artemis/hestia/HestiaDatabaseTest.java | 4 +- ...gExerciseSolutionEntryIntegrationTest.java | 4 +- ...rogrammingExerciseTaskIntegrationTest.java | 4 +- .../ProgrammingExerciseTaskServiceTest.java | 4 +- .../TestwiseCoverageIntegrationTest.java | 4 +- .../AttachmentResourceIntegrationTest.java | 4 +- .../AttachmentUnitIntegrationTest.java | 4 +- .../AttachmentUnitsIntegrationTest.java | 4 +- .../lecture/CompetencyIntegrationTest.java | 4 +- .../lecture/ExerciseUnitIntegrationTest.java | 4 +- .../lecture/LectureIntegrationTest.java | 4 +- .../lecture/LectureUnitIntegrationTest.java | 4 +- .../lecture/OnlineUnitIntegrationTest.java | 4 +- .../lecture/TextUnitIntegrationTest.java | 4 +- .../lecture/VideoUnitIntegrationTest.java | 4 +- .../metis/AbstractConversationTest.java | 5 +- .../metis/AnswerMessageIntegrationTest.java | 4 +- .../metis/AnswerPostIntegrationTest.java | 4 +- .../artemis/metis/MessageIntegrationTest.java | 4 +- .../artemis/metis/PostIntegrationTest.java | 4 +- .../metis/ReactionIntegrationTest.java | 4 +- .../migration/MigrationIntegrityTest.java | 4 +- .../migration/MigrationServiceTest.java | 4 +- .../GroupNotificationServiceTest.java | 4 +- .../NotificationResourceIntegrationTest.java | 4 +- .../NotificationScheduleServiceTest.java | 4 +- ...cationSettingsResourceIntegrationTest.java | 4 +- .../NotificationSettingsServiceTest.java | 4 +- .../PushNotificationResourceTest.java | 4 +- .../SingleUserNotificationServiceTest.java | 4 +- .../SystemNotificationIntegrationTest.java | 4 +- ...articipationSubmissionIntegrationTest.java | 4 +- .../SubmissionExportIntegrationTest.java | 4 +- .../SubmissionIntegrationTest.java | 4 +- .../PlagiarismCaseIntegrationTest.java | 4 +- .../PlagiarismCheckIntegrationTest.java | 4 +- .../plagiarism/PlagiarismIntegrationTest.java | 4 +- .../repository/StatisticsRepositoryTest.java | 4 +- .../service/AssessmentServiceTest.java | 4 +- .../service/BuildLogEntryServiceTest.java | 4 +- .../service/ComplaintResponseServiceTest.java | 4 +- .../CourseScoreCalculationServiceTest.java | 4 +- .../artemis/service/CourseServiceTest.java | 4 +- .../service/EmailSummaryServiceTest.java | 4 +- .../service/ExerciseDateServiceTest.java | 4 +- .../service/ExerciseLifecycleServiceTest.java | 4 +- .../service/FeatureToggleServiceTest.java | 4 +- .../artemis/service/FeedbackServiceTest.java | 4 +- .../www1/artemis/service/FileServiceTest.java | 4 +- .../service/GradingScaleServiceTest.java | 4 +- .../service/LectureImportServiceTest.java | 4 +- .../artemis/service/LectureServiceTest.java | 4 +- ...cipationAuthorizationCheckServiceTest.java | 4 +- .../ParticipationLifecycleServiceTest.java | 4 +- ...ParticipationTeamWebsocketServiceTest.java | 4 +- ...sentationPointsCalculationServiceTest.java | 4 +- .../service/ResourceLoaderServiceTest.java | 4 +- .../artemis/service/ResultServiceTest.java | 4 +- .../service/SubmissionServiceTest.java | 4 +- .../service/TeamWebsocketServiceTest.java | 4 +- .../TitleCacheEvictionServiceTest.java | 4 +- .../www1/artemis/service/UrlServiceTest.java | 4 +- .../artemis/service/ZipFileServiceTest.java | 4 +- .../service/exam/ExamAccessServiceTest.java | 4 +- .../service/exam/ExamQuizServiceTest.java | 4 +- .../artemis/service/exam/ExamServiceTest.java | 4 +- .../exam/ExamSubmissionServiceTest.java | 4 +- .../exam/StudentExamAccessServiceTest.java | 4 +- .../ConversationNotificationServiceTest.java | 5 +- .../TutorialGroupNotificationServiceTest.java | 4 +- ...ngExerciseFeedbackCreationServiceTest.java | 4 +- ...DeviceConfigurationCleanupServiceTest.java | 4 +- .../scheduled/cache/quiz/QuizCacheTest.java | 4 +- .../team/TeamImportIntegrationTest.java | 4 +- .../artemis/team/TeamIntegrationTest.java | 4 +- .../text/AssessmentEventIntegrationTest.java | 4 +- .../TextClusterResourceIntegrationTest.java | 4 +- .../text/TextExerciseIntegrationTest.java | 4 +- .../text/TextSubmissionIntegrationTest.java | 4 +- .../AbstractTutorialGroupIntegrationTest.java | 4 +- ...AndroidAppSiteAssociationResourceTest.java | 4 +- .../AppleAppSiteAssociationResourceTest.java | 4 +- 137 files changed, 546 insertions(+), 262 deletions(-) create mode 100644 src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java index 1f0a80ac3352..c73648bfa295 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractArchitectureTest.java @@ -8,7 +8,7 @@ import com.tngtech.archunit.core.importer.ClassFileImporter; import com.tngtech.archunit.core.importer.ImportOption; -public abstract class AbstractArchitectureTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +public abstract class AbstractArchitectureTest extends AbstractSpringIntegrationTest { protected static final String ARTEMIS_PACKAGE = "de.tum.in.www1.artemis"; diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java new file mode 100644 index 000000000000..0d9de8601534 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -0,0 +1,287 @@ +package de.tum.in.www1.artemis; + +import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST; + +import java.io.IOException; +import java.util.List; +import java.util.Set; + +import org.gitlab4j.api.GitLabApiException; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.ResourceLock; +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.HttpStatus; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit.jupiter.SpringExtension; + +import de.tum.in.www1.artemis.domain.*; +import de.tum.in.www1.artemis.domain.participation.AbstractBaseProgrammingExerciseParticipation; +import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation; +import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; +import de.tum.in.www1.artemis.util.*; +import io.zonky.test.db.AutoConfigureEmbeddedDatabase; + +@SpringBootTest +@AutoConfigureMockMvc +@ExtendWith(SpringExtension.class) +@ResourceLock(value = "AbstractSpringIntegrationTest") +@AutoConfigureEmbeddedDatabase +// NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! +@ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "scheduling" }) +@TestPropertySource(properties = { "artemis.user-management.use-external=false" }) +public abstract class AbstractSpringIntegrationTest extends AbstractArtemisIntegrationTest { + + @Override + public void mockConnectorRequestsForSetup(ProgrammingExercise exercise, boolean failToCreateCiProject) { + // Not implemented for local VC and local CI + } + + @Override + public void mockConnectorRequestsForImport(ProgrammingExercise sourceExercise, ProgrammingExercise exerciseToBeImported, boolean recreateBuildPlans, boolean addAuxRepos) { + // Not implemented for local VC and local CI + } + + @Override + public void mockConnectorRequestForImportFromFile(ProgrammingExercise exerciseForImport) { + // Not implemented for local VC and local CI + } + + @Override + public void mockImportProgrammingExerciseWithFailingEnablePlan(ProgrammingExercise sourceExercise, ProgrammingExercise exerciseToBeImported, boolean planExistsInCi, + boolean shouldPlanEnableFail) { + // Not implemented for local VC and local CI + } + + @Override + public void mockConnectorRequestsForStartParticipation(ProgrammingExercise exercise, String username, Set users, boolean ltiUserExists) { + // Not implemented for local VC and local CI + } + + @Override + public void mockConnectorRequestsForResumeParticipation(ProgrammingExercise exercise, String username, Set users, boolean ltiUserExists) { + // Not implemented for local VC and local CI + } + + @Override + public void mockUpdatePlanRepositoryForParticipation(ProgrammingExercise exercise, String username) { + // Not implemented for local VC and local CI + } + + @Override + public void mockUpdatePlanRepository(ProgrammingExercise exercise, String planName, String repoNameInCI, String repoNameInVcs, List triggeredBy) { + // Not implemented for local VC and local CI + } + + @Override + public void mockRemoveRepositoryAccess(ProgrammingExercise exercise, Team team, User firstStudent) { + // Not implemented for local VC and local CI + } + + @Override + public void mockCopyRepositoryForParticipation(ProgrammingExercise exercise, String username) { + // Not implemented for local VC and local CI + } + + @Override + public void mockRepositoryWritePermissionsForTeam(Team team, User newStudent, ProgrammingExercise exercise, HttpStatus status) { + // Not implemented for local VC and local CI + } + + @Override + public void mockRepositoryWritePermissionsForStudent(User student, ProgrammingExercise exercise, HttpStatus status) { + // Not implemented for local VC and local CI + } + + @Override + public void mockRetrieveArtifacts(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockFetchCommitInfo(String projectKey1, String repositorySlug, String hash) { + // Not implemented for local VC and local CI + } + + @Override + public void mockCopyBuildPlan(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockConfigureBuildPlan(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockTriggerFailedBuild(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockGrantReadAccess(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockNotifyPush(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockTriggerParticipationBuild(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockTriggerInstructorBuildAll(ProgrammingExerciseStudentParticipation participation) { + // Not implemented for local VC and local CI + } + + @Override + public void resetMockProvider() { + // Not implemented for local VC and local CI + } + + @Override + public void verifyMocks() { + // Not implemented for local VC and local CI + } + + @Override + public void mockUpdateUserInUserManagement(String oldLogin, User user, String password, Set oldGroups) { + // Not implemented for local VC and local CI + } + + @Override + public void mockUpdateCoursePermissions(Course updatedCourse, String oldInstructorGroup, String oldEditorGroup, String oldTeachingAssistantGroup) { + // Not implemented for local VC and local CI + } + + @Override + public void mockFailUpdateCoursePermissionsInCi(Course updatedCourse, String oldInstructorGroup, String oldEditorGroup, String oldTeachingAssistantGroup, + boolean failToAddUsers, boolean failToRemoveUsers) { + // Not implemented for local VC and local CI + } + + @Override + public void mockCreateUserInUserManagement(User user, boolean userExistsInCi) { + // Not implemented for local VC and local CI + } + + @Override + public void mockFailToCreateUserInExternalUserManagement(User user, boolean failInVcs, boolean failInCi, boolean failToGetCiUser) { + // Not implemented for local VC and local CI + } + + @Override + public void mockDeleteUserInUserManagement(User user, boolean userExistsInUserManagement, boolean failInVcs, boolean failInCi) { + // Not implemented for local VC and local CI + } + + @Override + public void mockCreateGroupInUserManagement(String groupName) { + // Not implemented for local VC and local CI + } + + @Override + public void mockDeleteGroupInUserManagement(String groupName) { + // Not implemented for local VC and local CI + } + + @Override + public void mockAddUserToGroupInUserManagement(User user, String group, boolean failInCi) { + // Not implemented for local VC and local CI + } + + @Override + public void mockRemoveUserFromGroup(User user, String group, boolean failInCi) throws Exception { + // Not implemented for local VC and local CI + } + + @Override + public void mockDeleteRepository(String projectKey1, String repositoryName, boolean shouldFail) { + // Not implemented for local VC and local CI + } + + @Override + public void mockDeleteProjectInVcs(String projectKey1, boolean shouldFail) { + // Not implemented for local VC and local CI + } + + @Override + public void mockDeleteBuildPlan(String projectKey1, String planName, boolean shouldFail) throws Exception { + // Not implemented for local VC and local CI + } + + @Override + public void mockDeleteBuildPlanProject(String projectKey1, boolean shouldFail) { + // Not implemented for local VC and local CI + } + + @Override + public void mockGetBuildPlan(String projectKey1, String planName, boolean planExistsInCi, boolean planIsActive, boolean planIsBuilding, boolean failToGetBuild) { + // Not implemented for local VC and local CI + } + + @Override + public void mockHealthInCiService(boolean isRunning, HttpStatus httpStatus) { + // Not implemented for local VC and local CI + } + + @Override + public void mockConfigureBuildPlan(ProgrammingExerciseParticipation participation, String defaultBranch) { + // Not implemented for local VC and local CI + } + + @Override + public void mockCheckIfProjectExistsInVcs(ProgrammingExercise exercise, boolean existsInVcs) { + // Not implemented for local VC and local CI + } + + @Override + public void mockCheckIfProjectExistsInCi(ProgrammingExercise exercise, boolean existsInCi, boolean shouldFail) { + // Not implemented for local VC and local CI + } + + @Override + public void mockCheckIfBuildPlanExists(String projectKey1, String templateBuildPlanId, boolean buildPlanExists, boolean shouldFail) { + // Not implemented for local VC and local CI + } + + @Override + public void mockRepositoryUrlIsValid(VcsRepositoryUrl vcsTemplateRepositoryUrl, String projectKey1, boolean b) throws Exception { + // Not implemented for local VC and local CI + } + + @Override + public void mockTriggerBuild(AbstractBaseProgrammingExerciseParticipation solutionParticipation) throws Exception { + // Not implemented for local VC and local CI + } + + @Override + public void mockTriggerBuildFailed(AbstractBaseProgrammingExerciseParticipation solutionParticipation) { + // Not implemented for local VC and local CI + } + + @Override + public void mockSetRepositoryPermissionsToReadOnly(VcsRepositoryUrl repositoryUrl, String projectKey1, Set users) throws Exception { + // Not implemented for local VC and local CI + } + + @Override + public void mockConfigureRepository(ProgrammingExercise exercise, String participantIdentifier, Set students, boolean userExists) { + // Not implemented for local VC and local CI + } + + @Override + public void mockDefaultBranch(ProgrammingExercise programmingExercise) throws IOException, GitLabApiException { + // Not implemented for local VC and local CI + } + + @Override + public void mockUserExists(String username) throws Exception { + // Not implemented for local VC and local CI + } +} diff --git a/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java b/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java index b3fe8d4e6a05..80a428e774f9 100644 --- a/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java +++ b/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java @@ -20,7 +20,7 @@ * * @see ClientForwardResource */ -class ClientForwardTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ClientForwardTest extends AbstractSpringIntegrationTest { @Autowired private JWTCookieService jwtCookieService; diff --git a/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java index 90f05369fcbd..5da15879a738 100644 --- a/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java @@ -15,7 +15,7 @@ import de.tum.in.www1.artemis.config.ApiVersionFilter; import de.tum.in.www1.artemis.user.UserUtilService; -class ContentVersionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ContentVersionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "contentversion"; diff --git a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java index db17e3683e4c..639a7975620f 100644 --- a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java +++ b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java @@ -14,7 +14,7 @@ import de.tum.in.www1.artemis.exam.ExamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class DatabaseQueryCountTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class DatabaseQueryCountTest extends AbstractSpringIntegrationTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); diff --git a/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java index 07453611b9e3..2c4656054aef 100644 --- a/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java @@ -38,7 +38,7 @@ import de.tum.in.www1.artemis.service.FilePathService; import de.tum.in.www1.artemis.user.UserUtilService; -class FileIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class FileIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "fileintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java b/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java index 1602c083edf4..664a67b3cbe8 100644 --- a/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java @@ -15,7 +15,7 @@ import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.user.UserUtilService; -class GuidedTourSettingResourceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class GuidedTourSettingResourceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "gtsettingtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java index e8a8625f0d8d..6b542450301d 100644 --- a/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java @@ -2,7 +2,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.*; -import static org.mockito.Mockito.argThat; import static org.mockito.Mockito.mockStatic; import java.io.IOException; @@ -21,7 +20,7 @@ import de.tum.in.www1.artemis.domain.enumeration.Language; import net.minidev.json.JSONObject; -class ImprintResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ImprintResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "ir"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java index 9499fcfd370f..1bcde36694d4 100644 --- a/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java @@ -10,7 +10,7 @@ import de.tum.in.www1.artemis.web.rest.vm.LoggerVM; -class LogResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class LogResourceIntegrationTest extends AbstractSpringIntegrationTest { @Test @WithMockUser(roles = "ADMIN") diff --git a/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java index ba7f057256e7..ef9a12a8c581 100644 --- a/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java @@ -15,7 +15,7 @@ import de.tum.in.www1.artemis.participation.ParticipationUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class LongFeedbackResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class LongFeedbackResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "longfeedbackintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java index 0a8cedd60144..f4d7310d8eba 100644 --- a/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java @@ -37,7 +37,7 @@ * see LTI message general details * see OpenId Connect launch flow */ -class Lti13LaunchIntegrationTest extends AbstractSpringIntegrationJenkinsGitlabTest { +class Lti13LaunchIntegrationTest extends AbstractSpringIntegrationTest { private static final Key SIGNING_KEY = new SecretKeySpec("a".repeat(100).getBytes(), SignatureAlgorithm.HS256.getJcaName()); diff --git a/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java index 3a27ad298350..0bec8f90b646 100644 --- a/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.OnlineCourseConfigurationRepository; import de.tum.in.www1.artemis.security.OAuth2JWKSService; -class OAuth2JWKSIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class OAuth2JWKSIntegrationTest extends AbstractSpringIntegrationTest { @Autowired private CourseRepository courseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java index 6f8eaadb8c09..ee5d98397599 100644 --- a/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java @@ -20,7 +20,7 @@ import de.tum.in.www1.artemis.domain.enumeration.Language; import net.minidev.json.JSONObject; -class PrivacyStatementResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PrivacyStatementResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "psr"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java index 05565d100a63..720b92913e78 100644 --- a/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java @@ -46,7 +46,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseManagementStatisticsDTO; import de.tum.in.www1.artemis.web.rest.dto.ExerciseManagementStatisticsDTO; -class StatisticsIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class StatisticsIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "statisticsintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java index 4d2f1ae0c736..17281980c919 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -39,7 +39,7 @@ import de.tum.in.www1.artemis.util.FileUtils; import de.tum.in.www1.artemis.web.rest.dto.SubmissionWithComplaintDTO; -class AssessmentComplaintIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AssessmentComplaintIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "assessmentcomplaintintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java index e033e41ecc32..abff5ffcbe51 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ComplaintType; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class AssessmentTeamComplaintIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AssessmentTeamComplaintIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "assmentteamcomplaint"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java index c9e9d7d90b46..da12cb26a3f7 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.service.ParticipationService; import de.tum.in.www1.artemis.user.UserUtilService; -class ComplaintResponseIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ComplaintResponseIntegrationTest extends AbstractSpringIntegrationTest { private final Logger log = LoggerFactory.getLogger(ComplaintResponseIntegrationTest.class); diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java index f1e49fb02064..f9ff48ebbe6a 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.util.FileUtils; import de.tum.in.www1.artemis.web.rest.dto.TextAssessmentDTO; -class ExampleSubmissionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExampleSubmissionIntegrationTest extends AbstractSpringIntegrationTest { private final Logger log = LoggerFactory.getLogger(ExampleSubmissionIntegrationTest.class); diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java index e5335333637f..f94c1e83fc9e 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.ExerciseScoresDTO; -class ExerciseScoresChartIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseScoresChartIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "exercisescoreschart"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java index a2afe884c270..0dedd44eb7de 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.exam.Exam; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.web.rest.dto.GradeDTO; import de.tum.in.www1.artemis.web.rest.dto.GradeStepsDTO; -class GradeStepIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class GradeStepIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "gradestep"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java index 474f5d38546c..5bd3a5805aa5 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.GradeStep; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.PageableSearchUtilService; -class GradingScaleIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class GradingScaleIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "gradingscale"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java index bd3b6d522f87..93958a50bc6a 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.competency.Competency; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.ScoreDTO; -class ParticipantScoreIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ParticipantScoreIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "participantscoreintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java index 9ff42e2be9f9..30624a11360c 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.Language; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.service.RatingService; import de.tum.in.www1.artemis.user.UserUtilService; -class RatingResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class RatingResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "ratingresourceintegrationtest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java index 6eed75ea217f..23e080f51a1f 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.repository.UserRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TutorEffortIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TutorEffortIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "tutoreffort"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java index 455499098824..6e1b17428b5a 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.TutorLeaderboardDTO; -class TutorLeaderboardServiceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TutorLeaderboardServiceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "tlbsitest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java index 2ae138e14657..5e2bfc3b3f2e 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class TutorParticipationIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TutorParticipationIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "tutorparticipationintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java index 2eb4f1f47dca..2f6018f3c5a8 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ExampleSubmission; @@ -23,7 +23,7 @@ import de.tum.in.www1.artemis.repository.TutorParticipationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TutorParticipationResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TutorParticipationResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "tutorparticipationresource"; diff --git a/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java index 778f43e9b32b..8cc5962d4d60 100644 --- a/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.GradingScaleUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.BonusExampleDTO; -class BonusIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class BonusIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "bonusintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java b/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java index 81025f1fc268..ade4c2ac4067 100644 --- a/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java +++ b/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java @@ -12,14 +12,14 @@ import org.springframework.messaging.simp.stomp.StompCommand; import org.springframework.messaging.simp.stomp.StompHeaderAccessor; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.websocket.WebsocketConfiguration; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.exam.ExamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; @SuppressWarnings("unchecked") -class TopicSubscriptionInterceptorTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TopicSubscriptionInterceptorTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "topicsubscriptioninterceptor"; diff --git a/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java b/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java index e62051329a60..bdd09037bdb3 100644 --- a/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java +++ b/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseFactory; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.participation.ParticipationFactory; import de.tum.in.www1.artemis.service.ExerciseService; -class ExerciseTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseTest extends AbstractSpringIntegrationTest { private Course course; diff --git a/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java b/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java index 1181af8dbd81..a300f807a0bd 100644 --- a/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java +++ b/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java @@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; import de.tum.in.www1.artemis.domain.enumeration.Visibility; import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; @@ -19,7 +19,7 @@ import de.tum.in.www1.artemis.repository.ResultRepository; import de.tum.in.www1.artemis.service.AssessmentService; -class ResultTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ResultTest extends AbstractSpringIntegrationTest { Result result = new Result(); diff --git a/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java index fee1e001dbb4..2c7f38509427 100644 --- a/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.participation.Participant; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.team.TeamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class ResultListenerIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ResultListenerIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "resultlistenerintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/exam/ExamActivityIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exam/ExamActivityIntegrationTest.java index 15e783ca80e7..e673128bf1c9 100644 --- a/src/test/java/de/tum/in/www1/artemis/exam/ExamActivityIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exam/ExamActivityIntegrationTest.java @@ -18,7 +18,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.ExamActionType; @@ -33,7 +33,7 @@ import de.tum.in.www1.artemis.util.RequestUtilService; import de.tum.in.www1.artemis.web.rest.ExamActivityResource; -class ExamActivityIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExamActivityIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "examactivity"; diff --git a/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java index 26df61ed14b8..ac007f95229c 100644 --- a/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java @@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.exam.Exam; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import inet.ipaddr.IPAddressString; -class ExamSessionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExamSessionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "examsessionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java index d5e307b6923a..c53c524f2eb2 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -37,7 +37,7 @@ import de.tum.in.www1.artemis.web.rest.dto.StatsForDashboardDTO; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ExerciseIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "exerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java index 57f4594a662c..2d0648ee0f5d 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class FileUploadAssessmentIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class FileUploadAssessmentIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "fileuploadassessment"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java index d49413654875..997716e74a46 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.IncludedInOverallScore; @@ -37,7 +37,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO; -class FileUploadExerciseIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class FileUploadExerciseIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "fileuploaderxercise"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java index 0c28793d2441..a1618f8d352e 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.InitializationState; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class FileUploadSubmissionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class FileUploadSubmissionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "fileuploadsubmission"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java index 8b0bb122ad28..9835a35564d6 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseFactory; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.CourseRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ApollonDiagramResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ApollonDiagramResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "repositoryintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java index 7fc6a4511c53..850f519cf1aa 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -40,7 +40,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class ModelingAssessmentIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ModelingAssessmentIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "modelingassessment"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java index 313bece4212c..a76f189aab67 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -41,7 +41,7 @@ import de.tum.in.www1.artemis.util.InvalidExamExerciseDatesArgumentProvider.InvalidExamExerciseDateConfiguration; import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; -class ModelingExerciseIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ModelingExerciseIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "modelingexerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java index e0e52c5c9a18..4c368898ad7c 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -47,7 +47,7 @@ import de.tum.in.www1.artemis.util.FileUtils; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ModelingSubmissionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ModelingSubmissionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "modelingsubmissionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java index 699a09f364af..ebb012efbd33 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java @@ -28,13 +28,13 @@ import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.File; import de.tum.in.www1.artemis.domain.FileType; import de.tum.in.www1.artemis.domain.Repository; import de.tum.in.www1.artemis.util.GitUtilService; -class GitServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class GitServiceTest extends AbstractSpringIntegrationTest { @Autowired private GitUtilService gitUtilService; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java index a30be74d26df..42be71f0bd77 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java @@ -19,12 +19,12 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.user.UserUtilService; import net.sourceforge.plantuml.SourceStringReader; import net.sourceforge.plantuml.core.DiagramDescription; -class PlantUmlIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PlantUmlIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "plantumlintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java index 277d800aa6b0..3d03fe20243e 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java @@ -19,7 +19,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; @@ -36,7 +36,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class ProgrammingAssessmentIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingAssessmentIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "programmingassessment"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java index 53f347dc69c7..24b1d6f1d833 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java @@ -22,7 +22,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.VcsRepositoryUrl; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.web.rest.ProgrammingExerciseResourceEndpoints; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ProgrammingExerciseGitIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseGitIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "progexgitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java index bed74e3d4160..9f47d6a2e675 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.participation.*; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseParticipationIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseParticipationIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "programmingexerciseparticipation"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java index 4b0711b07d34..52c17bd9b335 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java @@ -8,13 +8,13 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.repository.ProgrammingExerciseRepository; import de.tum.in.www1.artemis.service.programming.ProgrammingExerciseRepositoryService; -class ProgrammingExerciseRepositoryServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseRepositoryServiceTest extends AbstractSpringIntegrationTest { @Autowired private ProgrammingExerciseRepository programmingExerciseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java index cda556e95d55..678bf9a7baf3 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java @@ -10,13 +10,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.repository.ProgrammingExerciseRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "progexservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java index 211374c6c147..6ab1752ff7eb 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java @@ -23,7 +23,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -46,7 +46,7 @@ import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO; import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; -class QuizExerciseIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class QuizExerciseIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "quizexerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 9a03a48c7936..4a6e8fb73772 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -24,7 +24,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -40,7 +40,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; -class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "quizsubmissiontest"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java index a485b98a04a6..9e31aeb512f4 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.hestia.ProgrammingExerciseSolutionEntryRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class CodeHintIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class CodeHintIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "codehint"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java index fc31fe05fe6f..a13751ecde52 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; @SuppressWarnings("ArraysAsListWithZeroOrOneArgument") -class CodeHintServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class CodeHintServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "codehintservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java index dbaf0eb83581..4a3fed1455d0 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseHintIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseHintIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "exercisehintintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java index d25c4b1ca992..a20150629798 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; @@ -32,7 +32,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseHintServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseHintServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "exercisehintservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java index c35d9e94ab31..405770041a1a 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -30,7 +30,7 @@ * This currently includes ProgrammingExerciseTask, ProgrammingExerciseSolutionEntry and CodeHint. * It tests if the addition and deletion of these models works as expected. */ -class HestiaDatabaseTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class HestiaDatabaseTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "hestiadatabase"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java index aa9fa024f0ab..e3361b3b1688 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; import de.tum.in.www1.artemis.domain.hestia.CodeHint; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.hestia.ProgrammingExerciseTaskRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseSolutionEntryIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseSolutionEntryIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "progexsolutionentry"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java index 9b11eba3d624..98f6552d3591 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.DomainObject; import de.tum.in.www1.artemis.domain.ProgrammingExercise; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseTaskIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseTaskIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "progextask"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java index 153d9bfdbec9..efa36ed9aefd 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseTaskServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseTaskServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "progextaskservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java index 6ea13cb715ce..23e8930250d2 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.RequestUtilService; -class TestwiseCoverageIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TestwiseCoverageIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "testwisecoverageint"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java index 1365901b2fd3..a8bb91c85899 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java @@ -14,14 +14,14 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class AttachmentResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AttachmentResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "attachmentresourceintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java index 428985b572c4..764803e81990 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java @@ -27,7 +27,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Attachment; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.AttachmentUnit; @@ -37,7 +37,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class AttachmentUnitIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AttachmentUnitIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "attachmentunitintegrationtest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java index bae425f8390b..325eabd8b4eb 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java @@ -18,7 +18,7 @@ import org.springframework.mock.web.MockMultipartFile; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.AttachmentUnit; import de.tum.in.www1.artemis.repository.AttachmentUnitRepository; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.web.rest.dto.LectureUnitInformationDTO; import de.tum.in.www1.artemis.web.rest.dto.LectureUnitSplitDTO; -class AttachmentUnitsIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AttachmentUnitsIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "attachmentunitsintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java index ee3c632b2a28..b1fd2518e828 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java @@ -19,7 +19,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.competency.CompetencyUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -45,7 +45,7 @@ import de.tum.in.www1.artemis.util.PageableSearchUtilService; import de.tum.in.www1.artemis.web.rest.dto.CourseCompetencyProgressDTO; -class CompetencyIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class CompetencyIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "competencyintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java index 19386db708ac..5335c1c69e17 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.lecture.ExerciseUnit; @@ -21,7 +21,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseUnitIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseUnitIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "exerciseunitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java index aa20dcf457d3..b3e25aadbeb4 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.lecture.*; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.PageableSearchUtilService; -class LectureIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class LectureIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "lectureintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java index dca6b87250a9..7ab1db0ce168 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.competency.CompetencyUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class LectureUnitIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class LectureUnitIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "lectureunitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java index 3447da7411a1..ec11e7a101de 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.LectureUnit; import de.tum.in.www1.artemis.domain.lecture.OnlineUnit; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.OnlineResourceDTO; -class OnlineUnitIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class OnlineUnitIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "onlineunitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java index 99eb0e2328c3..10d537d46863 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.LectureUnit; import de.tum.in.www1.artemis.domain.lecture.TextUnit; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.TextUnitRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TextUnitIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TextUnitIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "textunitintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java index 01b3e1efd40b..47f9cbac56b2 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.LectureUnit; import de.tum.in.www1.artemis.domain.lecture.VideoUnit; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.VideoUnitRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class VideoUnitIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class VideoUnitIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "videounitintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java index 65ed87dc4650..e93aa9acf00b 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java @@ -1,7 +1,6 @@ package de.tum.in.www1.artemis.metis; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; import java.util.Arrays; @@ -14,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.messaging.simp.SimpMessageSendingOperations; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -41,7 +40,7 @@ /** * Contains useful methods for testing the conversations futures */ -abstract class AbstractConversationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +abstract class AbstractConversationTest extends AbstractSpringIntegrationTest { @Autowired CourseRepository courseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java index 84bee0af5372..f8433ef17fca 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.messaging.simp.SimpMessageSendingOperations; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.CourseInformationSharingConfiguration; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.dto.metis.PostDTO; -class AnswerMessageIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AnswerMessageIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "answermessageint"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java index 70866f2704dd..710859f22ddb 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.repository.metis.PostRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class AnswerPostIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AnswerPostIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "answerpostintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java index 81d073314ded..86ff09d11e2b 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java @@ -32,7 +32,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.CourseInformationSharingConfiguration; @@ -52,7 +52,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PostContextFilter; import de.tum.in.www1.artemis.web.websocket.dto.metis.PostDTO; -class MessageIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class MessageIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "messageintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java index f4348527a9ac..9ba733ac81b7 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java @@ -24,7 +24,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; import de.tum.in.www1.artemis.domain.Lecture; @@ -48,7 +48,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PostContextFilter; import de.tum.in.www1.artemis.web.websocket.dto.metis.PostDTO; -class PostIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PostIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "postintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java index 5d19715f8d7e..06472d61d95c 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.repository.metis.ReactionRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ReactionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ReactionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "reactionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java b/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java index 334a38704447..a996fe6e95c5 100644 --- a/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java +++ b/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java @@ -7,12 +7,12 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.migration.MigrationEntry; import de.tum.in.www1.artemis.config.migration.MigrationRegistry; import de.tum.in.www1.artemis.config.migration.MigrationService; -class MigrationIntegrityTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class MigrationIntegrityTest extends AbstractSpringIntegrationTest { @Autowired private MigrationRegistry migrationRegistry; diff --git a/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java index 80cd24fe66c4..1aa40436a24e 100644 --- a/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java @@ -20,7 +20,7 @@ import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Profiles; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.migration.MigrationEntry; import de.tum.in.www1.artemis.config.migration.MigrationIntegrityException; import de.tum.in.www1.artemis.config.migration.MigrationRegistry; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.migration.entries.TestChangeEntry20211216_231800; import de.tum.in.www1.artemis.repository.MigrationChangeRepository; -class MigrationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class MigrationServiceTest extends AbstractSpringIntegrationTest { @Autowired private MigrationRegistry registry; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java index 0c88635cfaaa..73618b571570 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java @@ -16,7 +16,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.QuizMode; @@ -33,7 +33,7 @@ import de.tum.in.www1.artemis.service.notifications.GroupNotificationScheduleService; import de.tum.in.www1.artemis.user.UserUtilService; -class GroupNotificationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class GroupNotificationServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "groupnotificationservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java index 9a03abf776b6..71c5d4a8cd56 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.NotificationSetting; import de.tum.in.www1.artemis.domain.User; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class NotificationResourceIntegrationTest extends AbstractSpringIntegrationTest { @Autowired private CourseRepository courseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java index d17467a32c1b..cb5a51fcb172 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java @@ -16,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.service.messaging.InstanceMessageReceiveService; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationScheduleServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class NotificationScheduleServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "notificationschedserv"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java index 10124449f739..be052bc3f2a1 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java @@ -12,13 +12,13 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.NotificationSetting; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationSettingsResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class NotificationSettingsResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "notificationsettingsresourrce"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java index 5fbbd4153dd8..5ccfe0a2cb34 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java @@ -13,7 +13,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.NotificationSetting; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.enumeration.NotificationType; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.service.notifications.NotificationSettingsService; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationSettingsServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class NotificationSettingsServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "notificationsettingsservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java index 6834da2b5cea..b3549aabaa3e 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceConfiguration; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceType; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.web.rest.push_notification.PushNotificationUnregisterRequest; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class PushNotificationResourceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PushNotificationResourceTest extends AbstractSpringIntegrationTest { @Autowired UserRepository userRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java index f8098fadde0e..79e809842755 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java @@ -27,7 +27,7 @@ import org.mockito.ArgumentCaptor; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -58,7 +58,7 @@ import de.tum.in.www1.artemis.service.notifications.SingleUserNotificationService; import de.tum.in.www1.artemis.user.UserUtilService; -class SingleUserNotificationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class SingleUserNotificationServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "singleusernotification"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java index f2339c306a2d..59e4edeadd2d 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java @@ -13,11 +13,11 @@ import org.springframework.security.test.context.support.WithAnonymousUser; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.notification.SystemNotification; import de.tum.in.www1.artemis.repository.SystemNotificationRepository; -class SystemNotificationIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class SystemNotificationIntegrationTest extends AbstractSpringIntegrationTest { @Autowired private SystemNotificationRepository systemNotificationRepo; diff --git a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java index 199aaa45dfd2..563a56a79413 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.SubmissionRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ParticipationSubmissionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ParticipationSubmissionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "psitest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java index d0aa44b0efe9..5358a5ed551d 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.Language; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.SubmissionExportOptionsDTO; -class SubmissionExportIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class SubmissionExportIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "submissionexportintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java index bcc04db80603..bcdfedf84f12 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java @@ -8,7 +8,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.util.PageableSearchUtilService; import de.tum.in.www1.artemis.web.rest.dto.PageableSearchDTO; -class SubmissionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class SubmissionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "submissionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java index defb4494d5a8..a1ce843b0623 100644 --- a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.exam.Exam; import de.tum.in.www1.artemis.domain.metis.Post; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PlagiarismCaseInfoDTO; import de.tum.in.www1.artemis.web.rest.dto.PlagiarismVerdictDTO; -class PlagiarismCaseIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PlagiarismCaseIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "plagiarismcaseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java index eee25e61421d..bb7a592669bb 100644 --- a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextExercise; import de.tum.in.www1.artemis.domain.modeling.ModelingExercise; @@ -20,7 +20,7 @@ import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class PlagiarismCheckIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PlagiarismCheckIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "plagiarismcheck"; diff --git a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java index 041ecdb28014..d7a96e4a491b 100644 --- a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextExercise; import de.tum.in.www1.artemis.domain.plagiarism.PlagiarismCase; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.PlagiarismComparisonStatusDTO; -class PlagiarismIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PlagiarismIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "plagiarismintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java b/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java index 4b5ef06893e4..0da3bb80fc37 100644 --- a/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java +++ b/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java @@ -15,7 +15,7 @@ import org.junit.jupiter.params.provider.EnumSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.PersistentAuditEvent; import de.tum.in.www1.artemis.domain.enumeration.GraphType; import de.tum.in.www1.artemis.domain.enumeration.SpanType; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class StatisticsRepositoryTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class StatisticsRepositoryTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "statisticsrepository"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java index 53895cf69960..ae29fa7212c4 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java @@ -15,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseFactory; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -36,7 +36,7 @@ import de.tum.in.www1.artemis.repository.ResultRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class AssessmentServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AssessmentServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "assessmentservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java index cbd61c178b7d..0d4a4a3b742d 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java @@ -14,11 +14,11 @@ import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.BuildLogEntry; import de.tum.in.www1.artemis.domain.enumeration.ProgrammingLanguage; -class BuildLogEntryServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class BuildLogEntryServiceTest extends AbstractSpringIntegrationTest { private static final String GRADLE_SCENARIO = """ Build ABC23H01E01 - AB12345 - Default Job #5 (MY-JOB) started building on agent ls1Agent-test.artemistest.in.tum.de, bamboo version: 8.2.5 diff --git a/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java index 879ac8ad47da..cbb7a0dcb2e4 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.team.TeamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class ComplaintResponseServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ComplaintResponseServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "complaintresponseservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java index eff0610fdfcb..aa8c6109bd2e 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java @@ -12,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.GradingScaleFactory; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseScoresDTO; import de.tum.in.www1.artemis.web.rest.dto.StudentScoresDTO; -class CourseScoreCalculationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class CourseScoreCalculationServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "cscservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java index 080f48520b84..e7a2a52b61f9 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java @@ -15,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextSubmission; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class CourseServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class CourseServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "courseservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java index c697908ad589..e0a1eda2e399 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java @@ -17,7 +17,7 @@ import org.mockito.ArgumentCaptor; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.DifficultyLevel; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.repository.NotificationSettingRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class EmailSummaryServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class EmailSummaryServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "emailsummaryservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java index 6ea4e0ca6eb4..37d1504a84ee 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java @@ -11,7 +11,7 @@ import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; import de.tum.in.www1.artemis.domain.exam.Exam; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseDateServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseDateServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "exercisedateservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java index 50232ec49d7c..74e2af4c6fae 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java @@ -11,12 +11,12 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Exercise; import de.tum.in.www1.artemis.domain.TextExercise; import de.tum.in.www1.artemis.domain.enumeration.ExerciseLifecycle; -class ExerciseLifecycleServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExerciseLifecycleServiceTest extends AbstractSpringIntegrationTest { @Autowired private ExerciseLifecycleService exerciseLifecycleService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java index 17072ad5d1a1..0b3ba9019da1 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java @@ -9,11 +9,11 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.service.feature.Feature; import de.tum.in.www1.artemis.service.feature.FeatureToggleService; -class FeatureToggleServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class FeatureToggleServiceTest extends AbstractSpringIntegrationTest { @Autowired private FeatureToggleService featureToggleService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java index 5259def297ac..9868c2d89c68 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java @@ -5,13 +5,13 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.Feedback; import de.tum.in.www1.artemis.domain.LongFeedbackText; import de.tum.in.www1.artemis.repository.FeedbackRepository; -class FeedbackServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class FeedbackServiceTest extends AbstractSpringIntegrationTest { @Autowired private FeedbackService feedbackService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java index 4132820ab37d..a87b0e6979bf 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java @@ -20,10 +20,10 @@ import org.springframework.core.io.Resource; import org.springframework.util.ResourceUtils; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.exception.FilePathParsingException; -class FileServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class FileServiceTest extends AbstractSpringIntegrationTest { @Autowired private ResourceLoaderService resourceLoaderService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java index c8d7df1d058d..950f1a986c9c 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java @@ -15,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.GradingScaleUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class GradingScaleServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class GradingScaleServiceTest extends AbstractSpringIntegrationTest { @Autowired private GradingScaleService gradingScaleService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java index c6d674baf25f..0ce3d2da61b4 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Attachment; import de.tum.in.www1.artemis.domain.Course; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.LectureRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class LectureImportServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class LectureImportServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "lectureimport"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java index 50c83fb9d213..99f7591ccea8 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.lecture.LectureFactory; import de.tum.in.www1.artemis.lecture.LectureUtilService; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PageableSearchDTO; import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO; -class LectureServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class LectureServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "lservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java index ac2fc33c1825..ff4cfad58d14 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.TextExercise; import de.tum.in.www1.artemis.domain.participation.ParticipationInterface; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.errors.AccessForbiddenException; -class ParticipationAuthorizationCheckServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ParticipationAuthorizationCheckServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "participationauthservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java index eba717ea7718..9e3b718226c9 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.enumeration.ParticipationLifecycle; @@ -23,7 +23,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class ParticipationLifecycleServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ParticipationLifecycleServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "partlcservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java index 755e1c04f945..10296d322fc9 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.messaging.simp.stomp.StompHeaderAccessor; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.modeling.ModelingExercise; import de.tum.in.www1.artemis.domain.participation.Participation; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.team.ParticipationTeamWebsocketService; -class ParticipationTeamWebsocketServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ParticipationTeamWebsocketServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "participationteamwebsocket"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java index 09e1f34130b5..ab488d80aaa3 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java @@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.GradingScaleFactory; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.StudentParticipationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class PresentationPointsCalculationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PresentationPointsCalculationServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "ppcservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java index 755c428e1af3..3b5c5dc2e58b 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java @@ -25,9 +25,9 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; -class ResourceLoaderServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ResourceLoaderServiceTest extends AbstractSpringIntegrationTest { @Autowired private ResourceLoaderService resourceLoaderService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java index eeafd1404e59..2449a2748e4e 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java @@ -12,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Feedback; import de.tum.in.www1.artemis.domain.ProgrammingExercise; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.repository.ProgrammingExerciseStudentParticipationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ResultServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ResultServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "resultservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java index 4b039d29e335..accf65af1531 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.web.rest.dto.SubmissionWithComplaintDTO; import de.tum.in.www1.artemis.web.rest.errors.AccessForbiddenException; -class SubmissionServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class SubmissionServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "submissionservicetest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java index ba417f0a9596..74b2d00ba5aa 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.dto.TeamAssignmentPayload; -class TeamWebsocketServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TeamWebsocketServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "teamwebsocketservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java index 5b9fe49d9702..0cb3609598a7 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.CacheManager; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -30,7 +30,7 @@ * The service is not directly injected / used here as it listens to Hibernate events, so we just apply * CRUD operations on the entities it supports. */ -class TitleCacheEvictionServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TitleCacheEvictionServiceTest extends AbstractSpringIntegrationTest { @Autowired private CacheManager cacheManager; diff --git a/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java index 126ebf821f2d..5a5cf4f8ed2f 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java @@ -8,14 +8,14 @@ import org.junit.jupiter.api.Test; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.VcsRepositoryUrl; import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; import de.tum.in.www1.artemis.domain.participation.SolutionProgrammingExerciseParticipation; import de.tum.in.www1.artemis.domain.participation.TemplateProgrammingExerciseParticipation; import de.tum.in.www1.artemis.exception.VersionControlException; -class UrlServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class UrlServiceTest extends AbstractSpringIntegrationTest { private final VcsRepositoryUrl repositoryUrl1 = new VcsRepositoryUrl("https://ab123cd@bitbucket.ase.in.tum.de/scm/EIST2016RME/RMEXERCISE-ab123cd"); diff --git a/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java index ce85b5e638ab..b273ec476c6a 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java @@ -10,9 +10,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; -class ZipFileServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ZipFileServiceTest extends AbstractSpringIntegrationTest { @Autowired private ZipFileService zipFileService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java index 2e7d287caebd..8095268a374a 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.web.rest.errors.ConflictException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ExamAccessServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExamAccessServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "examaccessservicetest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java index 26fa1023db6f..4c42dec32f7a 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.InitializationState; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.user.UserUtilService; -class ExamQuizServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExamQuizServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "eqservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java index d4f24384c817..d54d161771c6 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextExercise; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.web.rest.dto.ExamChecklistDTO; import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; -class ExamServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExamServiceTest extends AbstractSpringIntegrationTest { @Autowired private ExamService examService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java index dbd138dcb7e8..eee471c09860 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; @@ -32,7 +32,7 @@ import de.tum.in.www1.artemis.web.rest.errors.AccessForbiddenException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ExamSubmissionServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ExamSubmissionServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "esstest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java index 9efea706ccb8..2a66fcf326ba 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.web.rest.errors.ConflictException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class StudentExamAccessServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class StudentExamAccessServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "seastest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java index 433357cddc5d..0eaaa3f16f29 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java @@ -3,7 +3,6 @@ import static de.tum.in.www1.artemis.domain.notification.NotificationConstants.*; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; import java.time.ZonedDateTime; @@ -15,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.DomainObject; @@ -33,7 +32,7 @@ import de.tum.in.www1.artemis.repository.metis.conversation.ConversationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ConversationNotificationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ConversationNotificationServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "conversationnotificationservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java index 6e2ea3d4930c..b6579e5e9fa9 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java @@ -21,7 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.Language; @@ -38,7 +38,7 @@ import de.tum.in.www1.artemis.repository.tutorialgroups.TutorialGroupRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TutorialGroupNotificationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TutorialGroupNotificationServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "tutorialgroupnotifservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java index b198dbd50b7f..ac1331f509b7 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.Feedback; import de.tum.in.www1.artemis.domain.enumeration.ProgrammingLanguage; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.exercise.programmingexercise.ProgrammingExerciseFactory; import de.tum.in.www1.artemis.service.dto.StaticCodeAnalysisReportDTO; -class ProgrammingExerciseFeedbackCreationServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseFeedbackCreationServiceTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "progexfeedbackcreaiontest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java index c46cc58733c0..11a871e55582 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java @@ -12,14 +12,14 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceConfiguration; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceType; import de.tum.in.www1.artemis.repository.PushNotificationDeviceConfigurationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class PushNotificationDeviceConfigurationCleanupServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class PushNotificationDeviceConfigurationCleanupServiceTest extends AbstractSpringIntegrationTest { @Autowired private PushNotificationDeviceConfigurationRepository deviceConfigurationRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index 22cc3a2cd529..9d86e034e193 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -16,7 +16,7 @@ import com.hazelcast.core.HazelcastInstance; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Result; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.user.UserUtilService; -class QuizCacheTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class QuizCacheTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "quizcachetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java index 5a8d8fe9cab5..4971aa6283c3 100644 --- a/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -23,7 +23,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class TeamImportIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TeamImportIntegrationTest extends AbstractSpringIntegrationTest { @Autowired private CourseRepository courseRepo; diff --git a/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java index 4480cd86a5f3..ddd20d2313d6 100644 --- a/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; -class TeamIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TeamIntegrationTest extends AbstractSpringIntegrationTest { @Autowired private CourseRepository courseRepo; diff --git a/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java index ce9541bb838b..f50cf94d7575 100644 --- a/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.UserRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class AssessmentEventIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AssessmentEventIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "assessmentevent"; diff --git a/src/test/java/de/tum/in/www1/artemis/text/TextClusterResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/text/TextClusterResourceIntegrationTest.java index a0ad0c0f2fbb..5b682d8ced8f 100644 --- a/src/test/java/de/tum/in/www1/artemis/text/TextClusterResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/text/TextClusterResourceIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.TextClusterStatisticsDTO; -class TextClusterResourceIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TextClusterResourceIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "textclusterresource"; diff --git a/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java index ba9a8f6e4731..bcd5717fe006 100644 --- a/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java @@ -18,7 +18,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -50,7 +50,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; import de.tum.in.www1.artemis.web.rest.dto.PlagiarismComparisonStatusDTO; -class TextExerciseIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TextExerciseIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "textexerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java index d6e26426f056..930828caf8ff 100644 --- a/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -41,7 +41,7 @@ import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class TextSubmissionIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class TextSubmissionIntegrationTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "textsubmissionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java index 1ecd0ae8f185..f27714bc67fe 100644 --- a/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; import de.tum.in.www1.artemis.course.CourseTestService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.User; @@ -35,7 +35,7 @@ /** * Contains useful methods for testing the tutorial groups feature. */ -abstract class AbstractTutorialGroupIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +abstract class AbstractTutorialGroupIntegrationTest extends AbstractSpringIntegrationTest { @Autowired CourseTestService courseTestService; diff --git a/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java b/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java index 3798e8fb431e..3851fa1fd04d 100644 --- a/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java @@ -7,9 +7,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; -class AndroidAppSiteAssociationResourceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AndroidAppSiteAssociationResourceTest extends AbstractSpringIntegrationTest { @Autowired AndroidAppSiteAssociationResource androidAppSiteAssociationResource; diff --git a/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java b/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java index 74ad5fe60bea..cc3f11b35d9c 100644 --- a/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java @@ -5,9 +5,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; -class AppleAppSiteAssociationResourceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class AppleAppSiteAssociationResourceTest extends AbstractSpringIntegrationTest { @Autowired AppleAppSiteAssociationResource appleAppSiteAssociationResource; From b01f511ff5d7b09c406bb3e58c106f2c30e84c07 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:10:03 +0200 Subject: [PATCH 05/60] Rebalanced groups for more consistent testing time --- .../AbstractSpringIntegrationTest.java | 100 +++++++++--------- .../ParticipantScoreIntegrationTest.java | 4 +- .../ResultListenerIntegrationTest.java | 4 +- .../ModelingAssessmentIntegrationTest.java | 4 +- .../ModelingExerciseIntegrationTest.java | 4 +- .../ModelingSubmissionIntegrationTest.java | 4 +- ...rogrammingExerciseScheduleServiceTest.java | 30 ++---- ...ammingExerciseTemplateIntegrationTest.java | 16 ++- .../QuizSubmissionIntegrationTest.java | 4 +- .../lecture/CompetencyIntegrationTest.java | 4 +- .../artemis/metis/PostIntegrationTest.java | 4 +- .../NotificationScheduleServiceTest.java | 4 +- .../AbstractTutorialGroupIntegrationTest.java | 4 +- 13 files changed, 86 insertions(+), 100 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java index 0d9de8601534..2045d3bdcfe6 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -35,253 +35,253 @@ public abstract class AbstractSpringIntegrationTest extends AbstractArtemisInteg @Override public void mockConnectorRequestsForSetup(ProgrammingExercise exercise, boolean failToCreateCiProject) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockConnectorRequestsForImport(ProgrammingExercise sourceExercise, ProgrammingExercise exerciseToBeImported, boolean recreateBuildPlans, boolean addAuxRepos) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockConnectorRequestForImportFromFile(ProgrammingExercise exerciseForImport) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockImportProgrammingExerciseWithFailingEnablePlan(ProgrammingExercise sourceExercise, ProgrammingExercise exerciseToBeImported, boolean planExistsInCi, boolean shouldPlanEnableFail) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockConnectorRequestsForStartParticipation(ProgrammingExercise exercise, String username, Set users, boolean ltiUserExists) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockConnectorRequestsForResumeParticipation(ProgrammingExercise exercise, String username, Set users, boolean ltiUserExists) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockUpdatePlanRepositoryForParticipation(ProgrammingExercise exercise, String username) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockUpdatePlanRepository(ProgrammingExercise exercise, String planName, String repoNameInCI, String repoNameInVcs, List triggeredBy) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockRemoveRepositoryAccess(ProgrammingExercise exercise, Team team, User firstStudent) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockCopyRepositoryForParticipation(ProgrammingExercise exercise, String username) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockRepositoryWritePermissionsForTeam(Team team, User newStudent, ProgrammingExercise exercise, HttpStatus status) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockRepositoryWritePermissionsForStudent(User student, ProgrammingExercise exercise, HttpStatus status) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockRetrieveArtifacts(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockFetchCommitInfo(String projectKey1, String repositorySlug, String hash) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockCopyBuildPlan(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockConfigureBuildPlan(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockTriggerFailedBuild(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockGrantReadAccess(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockNotifyPush(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockTriggerParticipationBuild(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockTriggerInstructorBuildAll(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void resetMockProvider() { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void verifyMocks() { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockUpdateUserInUserManagement(String oldLogin, User user, String password, Set oldGroups) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockUpdateCoursePermissions(Course updatedCourse, String oldInstructorGroup, String oldEditorGroup, String oldTeachingAssistantGroup) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockFailUpdateCoursePermissionsInCi(Course updatedCourse, String oldInstructorGroup, String oldEditorGroup, String oldTeachingAssistantGroup, boolean failToAddUsers, boolean failToRemoveUsers) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockCreateUserInUserManagement(User user, boolean userExistsInCi) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockFailToCreateUserInExternalUserManagement(User user, boolean failInVcs, boolean failInCi, boolean failToGetCiUser) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockDeleteUserInUserManagement(User user, boolean userExistsInUserManagement, boolean failInVcs, boolean failInCi) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockCreateGroupInUserManagement(String groupName) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockDeleteGroupInUserManagement(String groupName) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockAddUserToGroupInUserManagement(User user, String group, boolean failInCi) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockRemoveUserFromGroup(User user, String group, boolean failInCi) throws Exception { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockDeleteRepository(String projectKey1, String repositoryName, boolean shouldFail) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockDeleteProjectInVcs(String projectKey1, boolean shouldFail) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockDeleteBuildPlan(String projectKey1, String planName, boolean shouldFail) throws Exception { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockDeleteBuildPlanProject(String projectKey1, boolean shouldFail) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockGetBuildPlan(String projectKey1, String planName, boolean planExistsInCi, boolean planIsActive, boolean planIsBuilding, boolean failToGetBuild) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockHealthInCiService(boolean isRunning, HttpStatus httpStatus) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockConfigureBuildPlan(ProgrammingExerciseParticipation participation, String defaultBranch) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockCheckIfProjectExistsInVcs(ProgrammingExercise exercise, boolean existsInVcs) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockCheckIfProjectExistsInCi(ProgrammingExercise exercise, boolean existsInCi, boolean shouldFail) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockCheckIfBuildPlanExists(String projectKey1, String templateBuildPlanId, boolean buildPlanExists, boolean shouldFail) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockRepositoryUrlIsValid(VcsRepositoryUrl vcsTemplateRepositoryUrl, String projectKey1, boolean b) throws Exception { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockTriggerBuild(AbstractBaseProgrammingExerciseParticipation solutionParticipation) throws Exception { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockTriggerBuildFailed(AbstractBaseProgrammingExerciseParticipation solutionParticipation) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockSetRepositoryPermissionsToReadOnly(VcsRepositoryUrl repositoryUrl, String projectKey1, Set users) throws Exception { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockConfigureRepository(ProgrammingExercise exercise, String participantIdentifier, Set students, boolean userExists) { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockDefaultBranch(ProgrammingExercise programmingExercise) throws IOException, GitLabApiException { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } @Override public void mockUserExists(String username) throws Exception { - // Not implemented for local VC and local CI + // Not implemented for AbstractSpringIntegrationTest } } diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java index 93958a50bc6a..2387d09cd012 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.competency.Competency; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.ScoreDTO; -class ParticipantScoreIntegrationTest extends AbstractSpringIntegrationTest { +class ParticipantScoreIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "participantscoreintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java index 2c7f38509427..fe602b3564b4 100644 --- a/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/entitylistener/ResultListenerIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.participation.Participant; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.team.TeamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class ResultListenerIntegrationTest extends AbstractSpringIntegrationTest { +class ResultListenerIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "resultlistenerintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java index 850f519cf1aa..51f83ff2d7af 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingAssessmentIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -40,7 +40,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class ModelingAssessmentIntegrationTest extends AbstractSpringIntegrationTest { +class ModelingAssessmentIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "modelingassessment"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java index 5fdd7cab6a7e..dd0f664dc14b 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingExerciseIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -41,7 +41,7 @@ import de.tum.in.www1.artemis.util.InvalidExamExerciseDatesArgumentProvider.InvalidExamExerciseDateConfiguration; import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; -class ModelingExerciseIntegrationTest extends AbstractSpringIntegrationTest { +class ModelingExerciseIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "modelingexerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java index 4c368898ad7c..6a24cd83f7ef 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ModelingSubmissionIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -47,7 +47,7 @@ import de.tum.in.www1.artemis.util.FileUtils; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ModelingSubmissionIntegrationTest extends AbstractSpringIntegrationTest { +class ModelingSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "modelingsubmissionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java index 3b088fc4bc4c..1154ce27afeb 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java @@ -11,6 +11,7 @@ import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.lib.ObjectId; +import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -20,9 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationGitlabCIGitlabSamlTest; import de.tum.in.www1.artemis.config.Constants; -import de.tum.in.www1.artemis.connector.BitbucketRequestMockProvider; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.VcsRepositoryUrl; @@ -43,7 +43,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.LocalRepository; -class ProgrammingExerciseScheduleServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseScheduleServiceTest extends AbstractSpringIntegrationGitlabCIGitlabSamlTest { private static final String TEST_PREFIX = "programmingexercisescheduleservice"; @@ -59,9 +59,6 @@ class ProgrammingExerciseScheduleServiceTest extends AbstractSpringIntegrationBa @Autowired private ProgrammingExerciseTestCaseRepository programmingExerciseTestCaseRepository; - @Autowired - private BitbucketRequestMockProvider bitbucketRequestMockProvider; - @Autowired private ExamRepository examRepository; @@ -94,7 +91,7 @@ class ProgrammingExerciseScheduleServiceTest extends AbstractSpringIntegrationBa @BeforeEach void init() throws Exception { studentRepository.configureRepos("studentLocalRepo", "studentOriginRepo"); - bitbucketRequestMockProvider.enableMockingOfRequests(true); + gitlabRequestMockProvider.enableMockingOfRequests(); doReturn(ObjectId.fromString("fffb09455885349da6e19d3ad7fd9c3404c5a0df")).when(gitService).getLastCommitHash(any()); userUtilService.addUsers(TEST_PREFIX, 3, 2, 0, 2); @@ -109,17 +106,9 @@ void init() throws Exception { } @AfterEach - void tearDown() throws InterruptedException { - // not yet finished scheduled futures may otherwise affect following tests + void tearDown() throws Exception { scheduleService.clearAllTasks(); - - // TODO: find a better solution in the future, because this makes the tests slower - // Some futures might already run while all tasks are cancelled. Waiting a bit makes sure the mocks are not called by the futures after the reset. - // Otherwise, the following test might fail. - Thread.sleep(500); // ok - - bambooRequestMockProvider.reset(); - bitbucketRequestMockProvider.reset(); + gitlabRequestMockProvider.reset(); } private void verifyLockStudentRepositoryAndParticipationOperation(boolean wasCalled, long timeoutInMs) { @@ -142,10 +131,10 @@ private void verifyLockStudentRepositoryAndParticipationOperation(boolean wasCal } } - private void mockStudentRepoLocks() throws URISyntaxException, GitAPIException { + private void mockStudentRepoLocks() throws URISyntaxException, GitAPIException, GitLabApiException { for (final var participation : programmingExercise.getStudentParticipations()) { - final var repositorySlug = (programmingExercise.getProjectKey() + "-" + participation.getParticipantIdentifier()).toLowerCase(); - bitbucketRequestMockProvider.mockSetRepositoryPermissionsToReadOnly(repositorySlug, programmingExercise.getProjectKey(), participation.getStudents()); + final VcsRepositoryUrl repositoryUrl = ((ProgrammingExerciseParticipation) participation).getVcsRepositoryUrl(); + gitlabRequestMockProvider.setRepositoryPermissionsToReadOnly(repositoryUrl, participation.getStudents()); doReturn(gitService.getExistingCheckedOutRepositoryByLocalPath(studentRepository.localRepoFile.toPath(), null)).when(gitService) .getOrCheckoutRepository((ProgrammingExerciseParticipation) participation); } @@ -396,7 +385,6 @@ void scheduleIndividualDueDateNoBuildAndTestDateLock() throws Exception { @Test @WithMockUser(username = "admin", roles = "ADMIN") void scheduleIndividualDueDateBetweenDueDateAndBuildAndTestDate() throws Exception { - bitbucketRequestMockProvider.reset(); mockStudentRepoLocks(); final long delayMS = 200; final ZonedDateTime now = ZonedDateTime.now(); diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java index f274ecbcc9bb..6e6a508c60c5 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java @@ -3,7 +3,6 @@ import static de.tum.in.www1.artemis.web.rest.ProgrammingExerciseResourceEndpoints.*; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Fail.fail; -import static org.mockito.Mockito.reset; import java.io.*; import java.nio.file.Files; @@ -33,7 +32,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationJenkinsGitlabTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; @@ -43,7 +42,7 @@ import de.tum.in.www1.artemis.util.LocalRepository; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class ProgrammingExerciseTemplateIntegrationTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { +class ProgrammingExerciseTemplateIntegrationTest extends AbstractSpringIntegrationJenkinsGitlabTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); @@ -109,8 +108,8 @@ void setup() throws Exception { programmingExerciseTestService.setupTestUsers(TEST_PREFIX, 1, 1, 0, 1); Course course = courseUtilService.addEmptyCourse(); exercise = ProgrammingExerciseFactory.generateProgrammingExercise(ZonedDateTime.now().minusDays(1), ZonedDateTime.now().plusDays(7), course); - bambooRequestMockProvider.enableMockingOfRequests(); - bitbucketRequestMockProvider.enableMockingOfRequests(true); + jenkinsRequestMockProvider.enableMockingOfRequests(jenkinsServer); + gitlabRequestMockProvider.enableMockingOfRequests(); exerciseRepo.configureRepos("exerciseLocalRepo", "exerciseOriginRepo"); testRepo.configureRepos("testLocalRepo", "testOriginRepo"); @@ -123,10 +122,9 @@ void setup() throws Exception { @AfterEach void tearDown() throws IOException { - reset(gitService); - reset(bambooServer); - bitbucketRequestMockProvider.reset(); - bambooRequestMockProvider.reset(); + jenkinsRequestMockProvider.enableMockingOfRequests(jenkinsServer); + gitlabRequestMockProvider.enableMockingOfRequests(); + exerciseRepo.resetLocalRepo(); testRepo.resetLocalRepo(); solutionRepo.resetLocalRepo(); diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 5067fadac884..47524cb7dab1 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -24,7 +24,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -40,7 +40,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; -class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationTest { +class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "quizsubmissiontest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java index b1fd2518e828..eb3a1cefd33e 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java @@ -19,7 +19,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.competency.CompetencyUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -45,7 +45,7 @@ import de.tum.in.www1.artemis.util.PageableSearchUtilService; import de.tum.in.www1.artemis.web.rest.dto.CourseCompetencyProgressDTO; -class CompetencyIntegrationTest extends AbstractSpringIntegrationTest { +class CompetencyIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "competencyintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java index e1ecd5f5e435..33d71512c183 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/PostIntegrationTest.java @@ -24,7 +24,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; import de.tum.in.www1.artemis.domain.Lecture; @@ -48,7 +48,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PostContextFilter; import de.tum.in.www1.artemis.web.websocket.dto.metis.PostDTO; -class PostIntegrationTest extends AbstractSpringIntegrationTest { +class PostIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "postintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java index cb5a51fcb172..bda13e55e4f9 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java @@ -16,7 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.service.messaging.InstanceMessageReceiveService; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationScheduleServiceTest extends AbstractSpringIntegrationTest { +class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "notificationschedserv"; diff --git a/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java index f27714bc67fe..4d8b9266e026 100644 --- a/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/tutorialgroups/AbstractTutorialGroupIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; import de.tum.in.www1.artemis.course.CourseTestService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.User; @@ -35,7 +35,7 @@ /** * Contains useful methods for testing the tutorial groups feature. */ -abstract class AbstractTutorialGroupIntegrationTest extends AbstractSpringIntegrationTest { +abstract class AbstractTutorialGroupIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { @Autowired CourseTestService courseTestService; From 3bc2b871780c2aaf9da72c8e6bb58218582947db Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 14 Jul 2023 12:57:46 +0200 Subject: [PATCH 06/60] Clean up code --- ...ingIntegrationBambooBitbucketJiraTest.java | 2 +- ...ringIntegrationGitlabCIGitlabSamlTest.java | 4 +- ...actSpringIntegrationJenkinsGitlabTest.java | 2 +- ...ctSpringIntegrationLocalCILocalVCTest.java | 2 +- .../AbstractSpringIntegrationTest.java | 149 ++++++++++-------- 5 files changed, 85 insertions(+), 74 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java index eba52aef570c..f7efe06c3d6b 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java @@ -60,7 +60,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@ResourceLock(value = "AbstractSpringIntegrationBambooBitbucketJiraTest") +@ResourceLock("AbstractSpringIntegrationBambooBitbucketJiraTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "bamboo", "bitbucket", "jira", "ldap", "scheduling", "athene", "apollon" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java index bcffcffb7d02..c7d59190fc92 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java @@ -1,7 +1,5 @@ package de.tum.in.www1.artemis; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.*; import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST; @@ -46,7 +44,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@ResourceLock(value = "AbstractSpringIntegrationGitlabCIGitlabSamlTest") +@ResourceLock("AbstractSpringIntegrationGitlabCIGitlabSamlTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "gitlabci", "gitlab", "saml2", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java index dd54bd4c0423..444c5560dffe 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java @@ -42,7 +42,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@ResourceLock(value = "AbstractSpringIntegrationJenkinsGitlabTest") +@ResourceLock("AbstractSpringIntegrationJenkinsGitlabTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "gitlab", "jenkins", "athene", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java index 0540c3b861ce..7425850cb2cc 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java @@ -55,7 +55,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@ResourceLock(value = "AbstractSpringIntegrationLocalCILocalVCTest") +@ResourceLock("AbstractSpringIntegrationLocalCILocalVCTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "localci", "localvc", "scheduling" }) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java index 2045d3bdcfe6..e758d3592cf9 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -2,13 +2,14 @@ import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST; -import java.io.IOException; import java.util.List; import java.util.Set; -import org.gitlab4j.api.GitLabApiException; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.ResourceLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; @@ -20,268 +21,280 @@ import de.tum.in.www1.artemis.domain.participation.AbstractBaseProgrammingExerciseParticipation; import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation; import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; -import de.tum.in.www1.artemis.util.*; +import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) -@ResourceLock(value = "AbstractSpringIntegrationTest") +@ResourceLock("AbstractSpringIntegrationTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "scheduling" }) @TestPropertySource(properties = { "artemis.user-management.use-external=false" }) -public abstract class AbstractSpringIntegrationTest extends AbstractArtemisIntegrationTest { +public class AbstractSpringIntegrationTest extends AbstractArtemisIntegrationTest { + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + @AfterEach + protected void resetSpyBeans() { + super.resetSpyBeans(); + } + + /** + * Note: This test group is used for tests that do not require to mock requests to the VC and CI server. + */ @Override public void mockConnectorRequestsForSetup(ProgrammingExercise exercise, boolean failToCreateCiProject) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConnectorRequestsForSetup with args {}, {}", exercise, failToCreateCiProject); } @Override public void mockConnectorRequestsForImport(ProgrammingExercise sourceExercise, ProgrammingExercise exerciseToBeImported, boolean recreateBuildPlans, boolean addAuxRepos) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConnectorRequestsForImport with args {}, {}, {}, {}", sourceExercise, exerciseToBeImported, recreateBuildPlans, addAuxRepos); } @Override public void mockConnectorRequestForImportFromFile(ProgrammingExercise exerciseForImport) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConnectorRequestForImportFromFile with args {}", exerciseForImport); } @Override public void mockImportProgrammingExerciseWithFailingEnablePlan(ProgrammingExercise sourceExercise, ProgrammingExercise exerciseToBeImported, boolean planExistsInCi, boolean shouldPlanEnableFail) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockImportProgrammingExerciseWithFailingEnablePlan with args {}, {}, {}, {}", sourceExercise, exerciseToBeImported, planExistsInCi, shouldPlanEnableFail); } @Override public void mockConnectorRequestsForStartParticipation(ProgrammingExercise exercise, String username, Set users, boolean ltiUserExists) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConnectorRequestsForStartParticipation with args {}, {}, {}, {}", exercise, username, users, ltiUserExists); } @Override public void mockConnectorRequestsForResumeParticipation(ProgrammingExercise exercise, String username, Set users, boolean ltiUserExists) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConnectorRequestsForResumeParticipation with args {}, {}, {}, {}", exercise, username, users, ltiUserExists); } @Override public void mockUpdatePlanRepositoryForParticipation(ProgrammingExercise exercise, String username) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockUpdatePlanRepositoryForParticipation with args {}, {}", exercise, username); } @Override public void mockUpdatePlanRepository(ProgrammingExercise exercise, String planName, String repoNameInCI, String repoNameInVcs, List triggeredBy) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockUpdatePlanRepository with args {}, {}, {}, {}, {}", exercise, planName, repoNameInCI, repoNameInVcs, triggeredBy); } @Override public void mockRemoveRepositoryAccess(ProgrammingExercise exercise, Team team, User firstStudent) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockRemoveRepositoryAccess with args {}, {}, {}", exercise, team, firstStudent); } @Override public void mockCopyRepositoryForParticipation(ProgrammingExercise exercise, String username) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockCopyRepositoryForParticipation with args {}, {}", exercise, username); } @Override public void mockRepositoryWritePermissionsForTeam(Team team, User newStudent, ProgrammingExercise exercise, HttpStatus status) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockRepositoryWritePermissionsForTeam with args {}, {}, {}, {}", team, newStudent, exercise, status); } @Override public void mockRepositoryWritePermissionsForStudent(User student, ProgrammingExercise exercise, HttpStatus status) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockRepositoryWritePermissionsForStudent with args {}, {}, {}", student, exercise, status); } @Override public void mockRetrieveArtifacts(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockRetrieveArtifacts with args {}", participation); } @Override - public void mockFetchCommitInfo(String projectKey1, String repositorySlug, String hash) { - // Not implemented for AbstractSpringIntegrationTest + public void mockFetchCommitInfo(String projectKey, String repositorySlug, String hash) { + log.debug("Called mockFetchCommitInfo with args {}, {}, {}", projectKey, repositorySlug, hash); } @Override public void mockCopyBuildPlan(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockCopyBuildPlan with args {}", participation); } @Override public void mockConfigureBuildPlan(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConfigureBuildPlan with args {}", participation); } @Override public void mockTriggerFailedBuild(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockTriggerFailedBuild with args {}", participation); } @Override public void mockGrantReadAccess(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockGrantReadAccess with args {}", participation); } @Override public void mockNotifyPush(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockNotifyPush with args {}", participation); } @Override public void mockTriggerParticipationBuild(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockTriggerParticipationBuild with args {}", participation); } @Override public void mockTriggerInstructorBuildAll(ProgrammingExerciseStudentParticipation participation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockTriggerInstructorBuildAll with args {}", participation); } @Override public void resetMockProvider() { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called resetMockProvider"); } @Override public void verifyMocks() { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called verifyMocks"); } @Override public void mockUpdateUserInUserManagement(String oldLogin, User user, String password, Set oldGroups) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockUpdateUserInUserManagement with args {}, {}, {}, {}", oldLogin, user, password, oldGroups); } @Override public void mockUpdateCoursePermissions(Course updatedCourse, String oldInstructorGroup, String oldEditorGroup, String oldTeachingAssistantGroup) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockUpdateCoursePermissions with args {}, {}, {}, {}", updatedCourse, oldInstructorGroup, oldEditorGroup, oldTeachingAssistantGroup); } @Override public void mockFailUpdateCoursePermissionsInCi(Course updatedCourse, String oldInstructorGroup, String oldEditorGroup, String oldTeachingAssistantGroup, boolean failToAddUsers, boolean failToRemoveUsers) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockFailUpdateCoursePermissionsInCi with args {}, {}, {}, {}, {}, {}", updatedCourse, oldInstructorGroup, oldEditorGroup, oldTeachingAssistantGroup, + failToAddUsers, failToRemoveUsers); } @Override public void mockCreateUserInUserManagement(User user, boolean userExistsInCi) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockCreateUserInUserManagement with args {}, {}", user, userExistsInCi); } @Override public void mockFailToCreateUserInExternalUserManagement(User user, boolean failInVcs, boolean failInCi, boolean failToGetCiUser) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockFailToCreateUserInExternalUserManagement with args {}, {}, {}, {}", user, failInVcs, failInCi, failToGetCiUser); } @Override public void mockDeleteUserInUserManagement(User user, boolean userExistsInUserManagement, boolean failInVcs, boolean failInCi) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockDeleteUserInUserManagement with args {}, {}, {}, {}", user, userExistsInUserManagement, failInVcs, failInCi); } @Override public void mockCreateGroupInUserManagement(String groupName) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockCreateGroupInUserManagement with args {}", groupName); } @Override public void mockDeleteGroupInUserManagement(String groupName) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockDeleteGroupInUserManagement with args {}", groupName); } @Override public void mockAddUserToGroupInUserManagement(User user, String group, boolean failInCi) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockAddUserToGroupInUserManagement with args {}, {}, {}", user, group, failInCi); } @Override - public void mockRemoveUserFromGroup(User user, String group, boolean failInCi) throws Exception { - // Not implemented for AbstractSpringIntegrationTest + public void mockRemoveUserFromGroup(User user, String group, boolean failInCi) { + log.debug("Called mockRemoveUserFromGroup with args {}, {}, {}", user, group, failInCi); } @Override - public void mockDeleteRepository(String projectKey1, String repositoryName, boolean shouldFail) { - // Not implemented for AbstractSpringIntegrationTest + public void mockDeleteRepository(String projectKey, String repositoryName, boolean shouldFail) { + log.debug("Called mockDeleteRepository with args {}, {}, {}", projectKey, repositoryName, shouldFail); } @Override - public void mockDeleteProjectInVcs(String projectKey1, boolean shouldFail) { - // Not implemented for AbstractSpringIntegrationTest + public void mockDeleteProjectInVcs(String projectKey, boolean shouldFail) { + log.debug("Called mockDeleteProjectInVcs with args {}, {}", projectKey, shouldFail); } @Override - public void mockDeleteBuildPlan(String projectKey1, String planName, boolean shouldFail) throws Exception { - // Not implemented for AbstractSpringIntegrationTest + public void mockDeleteBuildPlan(String projectKey, String planName, boolean shouldFail) { + log.debug("Called mockDeleteBuildPlan with args {}, {}, {}", projectKey, planName, shouldFail); } @Override - public void mockDeleteBuildPlanProject(String projectKey1, boolean shouldFail) { - // Not implemented for AbstractSpringIntegrationTest + public void mockDeleteBuildPlanProject(String projectKey, boolean shouldFail) { + log.debug("Called mockDeleteBuildPlanProject with args {}, {}", projectKey, shouldFail); } @Override - public void mockGetBuildPlan(String projectKey1, String planName, boolean planExistsInCi, boolean planIsActive, boolean planIsBuilding, boolean failToGetBuild) { - // Not implemented for AbstractSpringIntegrationTest + public void mockGetBuildPlan(String projectKey, String planName, boolean planExistsInCi, boolean planIsActive, boolean planIsBuilding, boolean failToGetBuild) { + log.debug("Called mockGetBuildPlan with args {}, {}, {}, {}, {}, {}", projectKey, planName, planExistsInCi, planIsActive, planIsBuilding, failToGetBuild); } @Override public void mockHealthInCiService(boolean isRunning, HttpStatus httpStatus) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockHealthInCiService with args {}, {}", isRunning, httpStatus); } @Override public void mockConfigureBuildPlan(ProgrammingExerciseParticipation participation, String defaultBranch) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConfigureBuildPlan with args {}, {}", participation, defaultBranch); } @Override public void mockCheckIfProjectExistsInVcs(ProgrammingExercise exercise, boolean existsInVcs) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockCheckIfProjectExistsInVcs with args {}, {}", exercise, existsInVcs); } @Override public void mockCheckIfProjectExistsInCi(ProgrammingExercise exercise, boolean existsInCi, boolean shouldFail) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockCheckIfProjectExistsInCi with args {}, {}, {}", exercise, existsInCi, shouldFail); } @Override - public void mockCheckIfBuildPlanExists(String projectKey1, String templateBuildPlanId, boolean buildPlanExists, boolean shouldFail) { - // Not implemented for AbstractSpringIntegrationTest + public void mockCheckIfBuildPlanExists(String projectKey, String templateBuildPlanId, boolean buildPlanExists, boolean shouldFail) { + log.debug("Called mockCheckIfBuildPlanExists with args {}, {}, {}, {}", projectKey, templateBuildPlanId, buildPlanExists, shouldFail); } @Override - public void mockRepositoryUrlIsValid(VcsRepositoryUrl vcsTemplateRepositoryUrl, String projectKey1, boolean b) throws Exception { - // Not implemented for AbstractSpringIntegrationTest + public void mockRepositoryUrlIsValid(VcsRepositoryUrl vcsTemplateRepositoryUrl, String projectKey, boolean b) { + log.debug("Called mockRepositoryUrlIsValid with args {}, {}, {}", vcsTemplateRepositoryUrl, projectKey, b); } @Override - public void mockTriggerBuild(AbstractBaseProgrammingExerciseParticipation solutionParticipation) throws Exception { - // Not implemented for AbstractSpringIntegrationTest + public void mockTriggerBuild(AbstractBaseProgrammingExerciseParticipation solutionParticipation) { + log.debug("Called mockTriggerBuild with args {}", solutionParticipation); } @Override public void mockTriggerBuildFailed(AbstractBaseProgrammingExerciseParticipation solutionParticipation) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockTriggerBuildFailed with args {}", solutionParticipation); } @Override - public void mockSetRepositoryPermissionsToReadOnly(VcsRepositoryUrl repositoryUrl, String projectKey1, Set users) throws Exception { - // Not implemented for AbstractSpringIntegrationTest + public void mockSetRepositoryPermissionsToReadOnly(VcsRepositoryUrl repositoryUrl, String projectKey, Set users) { + log.debug("Called mockSetRepositoryPermissionsToReadOnly with args {}, {}, {}", repositoryUrl, projectKey, users); } @Override public void mockConfigureRepository(ProgrammingExercise exercise, String participantIdentifier, Set students, boolean userExists) { - // Not implemented for AbstractSpringIntegrationTest + log.debug("Called mockConfigureRepository with args {}, {}, {}, {}", exercise, participantIdentifier, students, userExists); } @Override - public void mockDefaultBranch(ProgrammingExercise programmingExercise) throws IOException, GitLabApiException { - // Not implemented for AbstractSpringIntegrationTest + public void mockDefaultBranch(ProgrammingExercise programmingExercise) { + log.debug("Called mockDefaultBranch with args {}", programmingExercise); } @Override - public void mockUserExists(String username) throws Exception { - // Not implemented for AbstractSpringIntegrationTest + public void mockUserExists(String username) { + log.debug("Called mockUserExists with args {}", username); } } From ab6d48eeef87432b2b08ab0b5009113533db54ab Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 14 Jul 2023 13:35:17 +0200 Subject: [PATCH 07/60] Edit order of tests and allow 5 server starts --- .../AbstractSpringIntegrationBambooBitbucketJiraTest.java | 2 ++ .../AbstractSpringIntegrationGitlabCIGitlabSamlTest.java | 2 ++ .../AbstractSpringIntegrationJenkinsGitlabTest.java | 2 ++ .../AbstractSpringIntegrationLocalCILocalVCTest.java | 2 ++ .../tum/in/www1/artemis/AbstractSpringIntegrationTest.java | 2 ++ src/test/resources/junit-platform.properties | 7 +++++-- supporting_scripts/extract_number_of_server_starts.sh | 4 ++-- 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java index f7efe06c3d6b..b8d4fc860044 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java @@ -16,6 +16,7 @@ import java.util.Set; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; @@ -57,6 +58,7 @@ import de.tum.in.www1.artemis.web.rest.vm.ManagedUserVM; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; +@Order(1) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java index c7d59190fc92..27c158a1b84c 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java @@ -11,6 +11,7 @@ import org.gitlab4j.api.GitLabApiException; import org.gitlab4j.api.models.PipelineStatus; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; @@ -41,6 +42,7 @@ import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; +@Order(5) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java index 444c5560dffe..9d2f5531be38 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java @@ -13,6 +13,7 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; @@ -39,6 +40,7 @@ import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; +@Order(2) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java index 7425850cb2cc..023f75b79693 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java @@ -11,6 +11,7 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; @@ -52,6 +53,7 @@ // Must start up an actual web server such that the tests can communicate with the ArtemisGitServlet using JGit. // Otherwise, only MockMvc requests could be used. The port this runs on is defined at server.port (see @TestPropertySource). // Note: Cannot use WebEnvironment.RANDOM_PORT here because artemis.version-control.url must be set to the correct port in the @TestPropertySource annotation. +@Order(4) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java index e758d3592cf9..ff5832e9dff9 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -6,6 +6,7 @@ import java.util.Set; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.ResourceLock; import org.slf4j.Logger; @@ -24,6 +25,7 @@ import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; +@Order(3) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties index fa5d68923362..07d5a91a6289 100644 --- a/src/test/resources/junit-platform.properties +++ b/src/test/resources/junit-platform.properties @@ -1,8 +1,11 @@ # Enables junit5 parallel test execution. Tests are run on one JVM instance. junit.jupiter.execution.parallel.enabled = true -# Parallel execution of test classes. +# Parallel execution of tests within classes. junit.jupiter.execution.parallel.mode.default = concurrent -# Parallel execution of methods within test classes. +# Parallel execution of test-classes. junit.jupiter.execution.parallel.mode.classes.default = concurrent + +# Enables ordering test-classes with JUnit5 by @Order annotation (Used to start integration tests before unit tests). +junit.jupiter.testclass.order.default = org.junit.jupiter.api.ClassOrderer$OrderAnnotation diff --git a/supporting_scripts/extract_number_of_server_starts.sh b/supporting_scripts/extract_number_of_server_starts.sh index cc87238d4776..3677527b6f20 100644 --- a/supporting_scripts/extract_number_of_server_starts.sh +++ b/supporting_scripts/extract_number_of_server_starts.sh @@ -9,8 +9,8 @@ then exit 1 fi -if [[ $numberOfStarts -gt 4 ]] +if [[ $numberOfStarts -gt 5 ]] then - echo "The number of Server Starts should not be greater than 4!" + echo "The number of Server Starts should not be greater than 5!" exit 1 fi From cdbd3c0a800902aa3480421f53556e7107afa86a Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Tue, 18 Jul 2023 19:35:58 +0200 Subject: [PATCH 08/60] Disable failing Tests to get Coverage Report --- .../exercise/quizexercise/QuizSubmissionIntegrationTest.java | 5 ++--- .../artemis/service/scheduled/cache/quiz/QuizCacheTest.java | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 47524cb7dab1..7b8eac6aac57 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -12,9 +12,7 @@ import java.util.Arrays; import java.util.List; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.ValueSource; @@ -40,6 +38,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; +@Disabled("Enable when Fixed") // TODO: Fix failing tests for parallel execution class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "quizsubmissiontest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index ae58f09e5ab6..ac1e0faa59c2 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -8,6 +8,7 @@ import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +31,7 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.user.UserUtilService; +@Disabled("Enable when Fixed") // TODO: Fix failing tests for parallel execution class QuizCacheTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "quizcachetest"; From 2a11ade42bdb295c25a40875f560038fcd4e0658 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Wed, 26 Jul 2023 20:46:59 +0200 Subject: [PATCH 09/60] Testing File Logging - Not yet fully functioning --- .../LoggingExtension.java | 13 +++++++++++ .../org.junit.jupiter.api.extension.Extension | 1 + src/test/resources/junit-platform.properties | 3 +++ src/test/resources/logback.xml | 22 ++++++++++++++++--- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java create mode 100644 src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java new file mode 100644 index 000000000000..b4d704b19c00 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java @@ -0,0 +1,13 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.slf4j.MDC; + +public class LoggingExtension implements BeforeEachCallback { + + @Override + public void beforeEach(ExtensionContext context) throws Exception { + MDC.put("logFileName", context.getTestClass().orElseThrow().getSimpleName() + "/" + context.getTestMethod().orElseThrow().getName()); + } +} diff --git a/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension new file mode 100644 index 000000000000..7015232f2e6f --- /dev/null +++ b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -0,0 +1 @@ +de.tum.in.www1.artemis.util.parallelTestExecution.LoggingExtension diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties index 07d5a91a6289..b6055f2f3751 100644 --- a/src/test/resources/junit-platform.properties +++ b/src/test/resources/junit-platform.properties @@ -9,3 +9,6 @@ junit.jupiter.execution.parallel.mode.classes.default = concurrent # Enables ordering test-classes with JUnit5 by @Order annotation (Used to start integration tests before unit tests). junit.jupiter.testclass.order.default = org.junit.jupiter.api.ClassOrderer$OrderAnnotation + +# Enables JUnit5 automatic detection of extensions. +junit.jupiter.extensions.autodetection.enabled = true diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml index 0adc98c942a1..b059589aa30d 100644 --- a/src/test/resources/logback.xml +++ b/src/test/resources/logback.xml @@ -2,7 +2,23 @@ - + + + + + logFileName + unknown + + + + build/logs/${logFileName}.log + false + + %d{HH:mm:ss.SSS} | %-16.16thread | %-5level | %-36.36logger{36} : %msg%n + + + + @@ -36,8 +52,8 @@ - WARN - + ALL + From 8bb7449dbde3a464f77a7de190f518f59dbe94d7 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 27 Jul 2023 17:44:52 +0200 Subject: [PATCH 10/60] Run unit-tests sequentially, since they do not get their own Root Logger --- .../AbstractSpringIntegrationBambooBitbucketJiraTest.java | 3 +++ .../AbstractSpringIntegrationGitlabCIGitlabSamlTest.java | 3 +++ .../artemis/AbstractSpringIntegrationJenkinsGitlabTest.java | 3 +++ .../AbstractSpringIntegrationLocalCILocalVCTest.java | 3 +++ .../tum/in/www1/artemis/AbstractSpringIntegrationTest.java | 3 +++ src/test/resources/junit-platform.properties | 6 ------ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java index b8d4fc860044..8f75d362a839 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java @@ -18,6 +18,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; @@ -62,6 +64,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.CONCURRENT) @ResourceLock("AbstractSpringIntegrationBambooBitbucketJiraTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java index 27c158a1b84c..0cdf923b1487 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java @@ -13,6 +13,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; @@ -46,6 +48,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.CONCURRENT) @ResourceLock("AbstractSpringIntegrationGitlabCIGitlabSamlTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java index 9d2f5531be38..bd87c4c28635 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java @@ -15,6 +15,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; @@ -44,6 +46,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.CONCURRENT) @ResourceLock("AbstractSpringIntegrationJenkinsGitlabTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java index 023f75b79693..91ed675b81fd 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java @@ -13,6 +13,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.api.parallel.ResourceLock; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; @@ -57,6 +59,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.CONCURRENT) @ResourceLock("AbstractSpringIntegrationLocalCILocalVCTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java index ff5832e9dff9..0c889f2836ae 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -8,6 +8,8 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.junit.jupiter.api.parallel.ResourceLock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,6 +31,7 @@ @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) +@Execution(ExecutionMode.CONCURRENT) @ResourceLock("AbstractSpringIntegrationTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties index b6055f2f3751..05917f24e407 100644 --- a/src/test/resources/junit-platform.properties +++ b/src/test/resources/junit-platform.properties @@ -1,12 +1,6 @@ # Enables junit5 parallel test execution. Tests are run on one JVM instance. junit.jupiter.execution.parallel.enabled = true -# Parallel execution of tests within classes. -junit.jupiter.execution.parallel.mode.default = concurrent - -# Parallel execution of test-classes. -junit.jupiter.execution.parallel.mode.classes.default = concurrent - # Enables ordering test-classes with JUnit5 by @Order annotation (Used to start integration tests before unit tests). junit.jupiter.testclass.order.default = org.junit.jupiter.api.ClassOrderer$OrderAnnotation From e0ac1d0426e2335bedd651c8218dc90c7998507f Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 27 Jul 2023 19:32:31 +0200 Subject: [PATCH 11/60] Implemented Discriminator for SiftingAppender --- .../LoggingDiscriminator.java | 50 +++++++++++++++++++ .../LoggingExtension.java | 26 ++++++++-- src/test/resources/logback.xml | 11 ++-- 3 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java new file mode 100644 index 000000000000..e1792d9df722 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java @@ -0,0 +1,50 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.sift.Discriminator; + +/** + * Discriminator that allows us to write the logs of each test method to a separate file. + */ +public class LoggingDiscriminator implements Discriminator { + + private static final String KEY = "logFileName"; + + private static String value = "unknown-test"; + + private boolean isStarted; + + @Override + public String getDiscriminatingValue(ILoggingEvent iLoggingEvent) { + return value; + } + + @Override + public String getKey() { + return KEY; + } + + @Override + public void start() { + isStarted = true; + } + + @Override + public void stop() { + isStarted = false; + } + + @Override + public boolean isStarted() { + return isStarted; + } + + /** + * Sets the value of the discriminator. + * + * @param newValue usually a combination of the test class name and test method name + */ + static void setValue(String newValue) { + value = newValue; + } +} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java index b4d704b19c00..490676f1e2b5 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java @@ -1,13 +1,31 @@ package de.tum.in.www1.artemis.util.parallelTestExecution; +import static org.awaitility.Awaitility.await; + +import java.io.File; +import java.time.Duration; + +import org.junit.jupiter.api.extension.BeforeAllCallback; import org.junit.jupiter.api.extension.BeforeEachCallback; import org.junit.jupiter.api.extension.ExtensionContext; -import org.slf4j.MDC; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * JUnit 5 Extension that sets the value of the {@link LoggingDiscriminator} to a combination of the current test class name and test method name. + * This allows us to write the logs of each test instance to a separate file. + */ +public class LoggingExtension implements BeforeEachCallback, BeforeAllCallback { -public class LoggingExtension implements BeforeEachCallback { + @Override + public void beforeEach(ExtensionContext context) { + File logFile = new File(context.getTestClass().orElseThrow().getSimpleName(), context.getDisplayName().replace(File.separatorChar, ':')); + LoggingDiscriminator.setValue(logFile.toString()); + } @Override - public void beforeEach(ExtensionContext context) throws Exception { - MDC.put("logFileName", context.getTestClass().orElseThrow().getSimpleName() + "/" + context.getTestMethod().orElseThrow().getName()); + public void beforeAll(ExtensionContext context) { + // Wait until the logger is initialized + await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger); } } diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml index b059589aa30d..53c9efdab289 100644 --- a/src/test/resources/logback.xml +++ b/src/test/resources/logback.xml @@ -5,17 +5,14 @@ - - logFileName - unknown - + build/logs/${logFileName}.log false - + %d{HH:mm:ss.SSS} | %-16.16thread | %-5level | %-36.36logger{36} : %msg%n - + @@ -52,7 +49,7 @@ - ALL + WARN From 24e2799ec3cd14d4708fa7112a6cb543978403ae Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 28 Jul 2023 11:57:32 +0200 Subject: [PATCH 12/60] Remove @Disabled & @Execution(SAME_THREAD) --- .../exercise/quizexercise/QuizSubmissionIntegrationTest.java | 5 +++-- .../artemis/notification/NotificationTargetFactoryTest.java | 3 --- .../artemis/service/scheduled/cache/quiz/QuizCacheTest.java | 2 -- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 6c690f8b3ae5..dac81fda169d 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -12,7 +12,9 @@ import java.util.Arrays; import java.util.List; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.ValueSource; @@ -38,7 +40,6 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; -@Disabled("Enable when Fixed") // TODO: Fix failing tests for parallel execution class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { private static final String TEST_PREFIX = "quizsubmissiontest"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java index d4bea5711cdd..dc3d6630a870 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationTargetFactoryTest.java @@ -6,8 +6,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.parallel.Execution; -import org.junit.jupiter.api.parallel.ExecutionMode; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.metis.Post; @@ -15,7 +13,6 @@ import de.tum.in.www1.artemis.domain.notification.Notification; import de.tum.in.www1.artemis.domain.notification.NotificationTarget; -@Execution(ExecutionMode.SAME_THREAD) class NotificationTargetFactoryTest { private static Post post; diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index ac1e0faa59c2..ae58f09e5ab6 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -8,7 +8,6 @@ import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.springframework.beans.factory.annotation.Autowired; @@ -31,7 +30,6 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.user.UserUtilService; -@Disabled("Enable when Fixed") // TODO: Fix failing tests for parallel execution class QuizCacheTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "quizcachetest"; From bb4426f3d31e723955d4247825eeb15bf01ea1a7 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Wed, 2 Aug 2023 15:08:18 +0200 Subject: [PATCH 13/60] Improve logging - some tasks are still not mapped to the right test --- .../LoggingDiscriminator.java | 14 +++++++---- .../LoggingExtension.java | 23 ++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java index e1792d9df722..a0831f12349b 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java @@ -10,13 +10,18 @@ public class LoggingDiscriminator implements Discriminator { private static final String KEY = "logFileName"; - private static String value = "unknown-test"; + private InheritableThreadLocal value = new InheritableThreadLocal<>(); + + private String lastValue = "unknown"; private boolean isStarted; @Override public String getDiscriminatingValue(ILoggingEvent iLoggingEvent) { - return value; + if (value.get() == null) { + return lastValue; + } + return value.get(); } @Override @@ -44,7 +49,8 @@ public boolean isStarted() { * * @param newValue usually a combination of the test class name and test method name */ - static void setValue(String newValue) { - value = newValue; + void setValue(String newValue) { + lastValue = newValue; + value.set(newValue); } } diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java index 490676f1e2b5..b60c95dbcc0b 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java @@ -8,24 +8,31 @@ import org.junit.jupiter.api.extension.BeforeAllCallback; import org.junit.jupiter.api.extension.BeforeEachCallback; import org.junit.jupiter.api.extension.ExtensionContext; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import ch.qos.logback.classic.Logger; +import ch.qos.logback.classic.sift.SiftingAppender; + /** * JUnit 5 Extension that sets the value of the {@link LoggingDiscriminator} to a combination of the current test class name and test method name. * This allows us to write the logs of each test instance to a separate file. */ -public class LoggingExtension implements BeforeEachCallback, BeforeAllCallback { +public class LoggingExtension implements BeforeAllCallback, BeforeEachCallback { @Override - public void beforeEach(ExtensionContext context) { - File logFile = new File(context.getTestClass().orElseThrow().getSimpleName(), context.getDisplayName().replace(File.separatorChar, ':')); - LoggingDiscriminator.setValue(logFile.toString()); + public void beforeAll(ExtensionContext context) { + // Wait until the logger is initialized + await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof Logger); } @Override - public void beforeAll(ExtensionContext context) { - // Wait until the logger is initialized - await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger); + public void beforeEach(ExtensionContext context) { + File logFile = new File(context.getTestClass().orElseThrow().getSimpleName(), context.getDisplayName().replace(File.separatorChar, ':')); + + Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); + SiftingAppender appender = (SiftingAppender) logger.getAppender("SIFT"); + LoggingDiscriminator loggingDiscriminator = (LoggingDiscriminator) appender.getDiscriminator(); + + loggingDiscriminator.setValue(logFile.toString()); } } From 058c578fe1b1aa7f78335fe78a79205a9dc23f89 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Wed, 16 Aug 2023 20:41:33 +0200 Subject: [PATCH 14/60] Added information to logs for debugging --- .../LoggingDiscriminator.java | 35 ++++++++++++++++--- .../LoggingExtension.java | 30 ++++++++-------- .../util/parallelTestExecution/TestGroup.java | 35 +++++++++++++++++++ .../TestGroupConverter.java | 16 +++++++++ .../ThreadIdConverter.java | 12 +++++++ .../ThreadLocalIdConverter.java | 12 +++++++ src/test/resources/logback.xml | 15 +++++++- 7 files changed, 135 insertions(+), 20 deletions(-) create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java index a0831f12349b..89942338b3c9 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java @@ -10,16 +10,20 @@ public class LoggingDiscriminator implements Discriminator { private static final String KEY = "logFileName"; - private InheritableThreadLocal value = new InheritableThreadLocal<>(); + private static final String DEFAULT = "unknown"; - private String lastValue = "unknown"; + private static final InheritableThreadLocal value = new InheritableThreadLocal<>(); + + private static final InheritableThreadLocal threadId = new InheritableThreadLocal<>(); + + private static final InheritableThreadLocal testGroup = new InheritableThreadLocal<>(); private boolean isStarted; @Override public String getDiscriminatingValue(ILoggingEvent iLoggingEvent) { if (value.get() == null) { - return lastValue; + return DEFAULT; } return value.get(); } @@ -49,8 +53,29 @@ public boolean isStarted() { * * @param newValue usually a combination of the test class name and test method name */ - void setValue(String newValue) { - lastValue = newValue; + static void setValue(String newValue) { value.set(newValue); } + + static void setThreadId(Long newValue) { + threadId.set(newValue); + } + + static void setTestGroup(TestGroup newValue) { + testGroup.set(newValue); + } + + static void clear() { + threadId.remove(); + value.remove(); + testGroup.remove(); + } + + static Long getThreadId() { + return threadId.get(); + } + + static TestGroup getTestGroup() { + return testGroup.get(); + } } diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java index b60c95dbcc0b..a25d2e3ac775 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java @@ -5,34 +5,36 @@ import java.io.File; import java.time.Duration; -import org.junit.jupiter.api.extension.BeforeAllCallback; -import org.junit.jupiter.api.extension.BeforeEachCallback; -import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.*; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import ch.qos.logback.classic.Logger; -import ch.qos.logback.classic.sift.SiftingAppender; - /** * JUnit 5 Extension that sets the value of the {@link LoggingDiscriminator} to a combination of the current test class name and test method name. * This allows us to write the logs of each test instance to a separate file. */ -public class LoggingExtension implements BeforeAllCallback, BeforeEachCallback { +public class LoggingExtension implements BeforeAllCallback, BeforeEachCallback, AfterAllCallback { + + private static final Logger log = LoggerFactory.getLogger(LoggingExtension.class); @Override public void beforeAll(ExtensionContext context) { + File logFile = new File(context.getTestClass().orElseThrow().getSimpleName()); + LoggingDiscriminator.setValue(logFile.toString()); + LoggingDiscriminator.setTestGroup(TestGroup.fromClass(context.getRequiredTestClass())); + LoggingDiscriminator.setThreadId(Thread.currentThread().getId()); + // Wait until the logger is initialized - await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof Logger); + await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger); } @Override public void beforeEach(ExtensionContext context) { - File logFile = new File(context.getTestClass().orElseThrow().getSimpleName(), context.getDisplayName().replace(File.separatorChar, ':')); - - Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); - SiftingAppender appender = (SiftingAppender) logger.getAppender("SIFT"); - LoggingDiscriminator loggingDiscriminator = (LoggingDiscriminator) appender.getDiscriminator(); + log.info("Starting test: {} > {}", context.getRequiredTestClass().getSimpleName(), context.getDisplayName()); + } - loggingDiscriminator.setValue(logFile.toString()); + @Override + public void afterAll(ExtensionContext extensionContext) throws Exception { + LoggingDiscriminator.clear(); } } diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java new file mode 100644 index 000000000000..9e088b518d0b --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java @@ -0,0 +1,35 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import de.tum.in.www1.artemis.*; +import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; + +public enum TestGroup { + + BAMBOO(AbstractSpringIntegrationBambooBitbucketJiraTest.class), GITLAB_CI(AbstractSpringIntegrationGitlabCIGitlabSamlTest.class), + JENKINS(AbstractSpringIntegrationJenkinsGitlabTest.class), LOCAL(AbstractSpringIntegrationLocalCILocalVCTest.class), SIMPLE(AbstractSpringIntegrationTest.class), + UNIT_TEST(null); + + private final Class clazz; + + TestGroup(Class clazz) { + this.clazz = clazz; + } + + public static TestGroup fromClass(Class clazz) { + if (clazz == null) { + return null; + } + + for (TestGroup group : values()) { + if (group.clazz != null && group.clazz.isAssignableFrom(clazz)) { + return group; + } + } + + if (AbstractArtemisIntegrationTest.class.isAssignableFrom(clazz)) { + throw new RuntimeException("Test class " + clazz.getName() + " extends ArtemisIntegrationTest but is not assigned to a test group"); + } + + return UNIT_TEST; + } +} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java new file mode 100644 index 000000000000..622d5e037532 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java @@ -0,0 +1,16 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import ch.qos.logback.classic.pattern.ClassicConverter; +import ch.qos.logback.classic.spi.ILoggingEvent; + +public class TestGroupConverter extends ClassicConverter { + + @Override + public String convert(ILoggingEvent iLoggingEvent) { + TestGroup group = LoggingDiscriminator.getTestGroup(); + if (group == null) { + return ""; + } + return "" + LoggingDiscriminator.getTestGroup().name(); + } +} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java new file mode 100644 index 000000000000..b396ec924269 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java @@ -0,0 +1,12 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import ch.qos.logback.classic.pattern.ClassicConverter; +import ch.qos.logback.classic.spi.ILoggingEvent; + +public class ThreadIdConverter extends ClassicConverter { + + @Override + public String convert(ILoggingEvent iLoggingEvent) { + return "" + Thread.currentThread().getId(); + } +} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java new file mode 100644 index 000000000000..7a59a2e63209 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java @@ -0,0 +1,12 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import ch.qos.logback.classic.pattern.ClassicConverter; +import ch.qos.logback.classic.spi.ILoggingEvent; + +public class ThreadLocalIdConverter extends ClassicConverter { + + @Override + public String convert(ILoggingEvent iLoggingEvent) { + return "" + LoggingDiscriminator.getThreadId(); + } +} diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml index 53c9efdab289..9a681b741d24 100644 --- a/src/test/resources/logback.xml +++ b/src/test/resources/logback.xml @@ -4,6 +4,10 @@ + + + + @@ -11,12 +15,20 @@ build/logs/${logFileName}.log false - %d{HH:mm:ss.SSS} | %-16.16thread | %-5level | %-36.36logger{36} : %msg%n + %d{HH:mm:ss.SSS} | %3.3threadLocalId --> %3.3threadId == %9.9testGroup | %-16.16thread | %-5level | %-36.36logger{36} : %msg%n + + build/logs/allLogs.log + false + + %d{HH:mm:ss.SSS} | %3.3threadLocalId --> %3.3threadId == %9.9testGroup | %-16.16thread | %-5level | %-36.36logger{36} : %msg%n + + + @@ -51,6 +63,7 @@ WARN + From 318326c8682a912d8f13298f5b0a3276d6fe6391 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:30:14 +0200 Subject: [PATCH 15/60] New debug information --- .../service/scheduled/cache/quiz/QuizCache.java | 6 ++++++ .../LoggingDiscriminator.java | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java b/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java index e7c52ffacd8f..9cccd263284b 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java +++ b/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java @@ -35,10 +35,14 @@ final class QuizCache extends CacheHandler { private final ITopic cachedQuizExerciseUpdates; + private final Long threadIdOnCreation; + public QuizCache(HazelcastInstance hazelcastInstance) { super(hazelcastInstance, Constants.HAZELCAST_EXERCISE_CACHE); this.cachedQuizExerciseUpdates = hazelcastInstance.getTopic(HAZELCAST_CACHED_EXERCISE_UPDATE_TOPIC); this.cachedQuizExerciseUpdates.addMessageListener(newQuizExerciseMessage -> updateQuizExerciseLocally(newQuizExerciseMessage.getMessageObject())); + this.threadIdOnCreation = Thread.currentThread().getId(); + System.out.println("Parallel Debug Info: QuizCache created in " + threadIdOnCreation); } /** @@ -100,6 +104,7 @@ void updateQuizExercise(QuizExercise quizExercise) { Objects.requireNonNull(quizExercise, "quizExercise must not be null"); // Send every instance (including itself) a message to update the quizExercise of the corresponding QuizExerciseCache locally cachedQuizExerciseUpdates.publish(quizExercise); + System.out.println("Parallel debug info: QuizCache updateQuizExercise in " + threadIdOnCreation + " -> " + Thread.currentThread().getId()); } /** @@ -110,5 +115,6 @@ void updateQuizExercise(QuizExercise quizExercise) { private void updateQuizExerciseLocally(QuizExercise quizExercise) { logger.debug("Quiz exercise {} updated in quiz exercise map: {}", quizExercise.getId(), quizExercise); getTransientWriteCacheFor(quizExercise.getId()).setExercise(quizExercise); + System.out.println("Parallel debug info: QuizCache updateQuizExerciseLocally in " + threadIdOnCreation + " -> " + Thread.currentThread().getId()); } } diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java index 89942338b3c9..43b21bea891e 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java @@ -20,8 +20,16 @@ public class LoggingDiscriminator implements Discriminator { private boolean isStarted; + private Long threadIdOnStart; + + public LoggingDiscriminator() { + threadIdOnStart = Thread.currentThread().getId(); + System.out.println("Parallel Debug Info: LoggingDiscriminator created in " + threadIdOnStart); + } + @Override public String getDiscriminatingValue(ILoggingEvent iLoggingEvent) { + System.out.println("Parallel Debug Info: LoggingDiscriminator.getDiscriminatingValue() called for " + threadIdOnStart); if (value.get() == null) { return DEFAULT; } @@ -36,11 +44,13 @@ public String getKey() { @Override public void start() { isStarted = true; + System.out.println("Parallel Debug Info: LoggingDiscriminator started in " + threadIdOnStart); } @Override public void stop() { isStarted = false; + System.out.println("Parallel Debug Info: LoggingDiscriminator stopped in " + threadIdOnStart); } @Override @@ -78,4 +88,10 @@ static Long getThreadId() { static TestGroup getTestGroup() { return testGroup.get(); } + + @Override + protected void finalize() throws Throwable { + System.out.println("Parallel Debug Info: LoggingDiscriminator finalized in " + threadIdOnStart); + super.finalize(); + } } From 07fd40cf5c81189e957011100f279cd78a454fe1 Mon Sep 17 00:00:00 2001 From: lara Date: Sun, 20 Aug 2023 00:09:26 +0200 Subject: [PATCH 16/60] fix quiz tests --- .../QuizExerciseIntegrationTest.java | 17 +- .../QuizSubmissionIntegrationTest.java | 176 ++++++------------ 2 files changed, 65 insertions(+), 128 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java index a4c3d9542350..78732c202602 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java @@ -4,7 +4,6 @@ import static org.assertj.core.api.Assertions.byLessThan; import static org.awaitility.Awaitility.await; -import java.security.Principal; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.*; @@ -18,7 +17,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; @@ -338,19 +336,10 @@ void testDeleteQuizExerciseWithSubmittedAnswers(QuizMode quizMode) throws Except QuizExercise quizExercise = quizExerciseUtilService.createAndSaveQuiz(ZonedDateTime.now(), ZonedDateTime.now().plusMinutes(1), quizMode); assertThat(quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId())).as("Exercise is created correctly").isNotNull(); - String username = TEST_PREFIX + "student1"; - final Principal principal = () -> username; QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, null); - - Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - quizUtilService.prepareBatchForSubmitting(quizExercise, authentication, SecurityUtils.makeAuthorizationObject(username)); - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); - SecurityContextHolder.getContext().setAuthentication(authentication); - - // Quiz submissions are not yet in database - assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).isEmpty(); - - quizScheduleService.processCachedQuizSubmissions(); + quizSubmission.submitted(true); + participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student1"); + participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); // Quiz submissions are now in database assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).hasSize(1); diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index bb0b9cb9f299..c033cfd8e1d3 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -4,13 +4,10 @@ import static org.awaitility.Awaitility.await; import static org.mockito.Mockito.*; -import java.security.Principal; import java.time.Duration; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.*; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -29,14 +26,17 @@ import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Result; +import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.enumeration.QuizMode; import de.tum.in.www1.artemis.domain.enumeration.ScoringType; import de.tum.in.www1.artemis.domain.exam.ExerciseGroup; import de.tum.in.www1.artemis.domain.quiz.*; import de.tum.in.www1.artemis.exam.ExamUtilService; +import de.tum.in.www1.artemis.participation.ParticipationUtilService; import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.service.QuizBatchService; import de.tum.in.www1.artemis.service.QuizExerciseService; +import de.tum.in.www1.artemis.service.QuizStatisticService; import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; @@ -92,6 +92,12 @@ class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILoca @Autowired private ExamUtilService examUtilService; + @Autowired + QuizStatisticService quizStatisticService; + + @Autowired + ParticipationUtilService participationUtilService; + @BeforeEach void init() { // do not use the schedule service based on a time interval in the tests, because this would result in flaky tests that run much slower @@ -112,45 +118,33 @@ void testQuizSubmit() { QuizSubmission quizSubmission; - for (int i = 1; i <= NUMBER_OF_STUDENTS; i++) { + // only half of the students submit + for (int i = 1; i <= NUMBER_OF_STUDENTS / 2; i++) { quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, i, false, null); - final var username = TEST_PREFIX + "student" + i; - final Principal principal = () -> username; - // save - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); - } + quizSubmission.setSubmitted(true); + participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student" + i); + participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); - // only half of the students submit manually - for (int i = 1; i <= NUMBER_OF_STUDENTS / 2; i++) { - quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, i, true, null); - final var username = TEST_PREFIX + "student" + i; - final Principal principal = () -> username; - // submit - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); } - // before the quiz submissions are processed, none of them ends up in the database - assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isZero(); - - // process first half of the submissions - quizScheduleService.processCachedQuizSubmissions(); + // check first half of the submissions assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isEqualTo(NUMBER_OF_STUDENTS / 2); - // End the quiz right now so that results can be processed - quizExercise = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); - final var exercise = quizExercise; - assertThat(quizExercise).isNotNull(); - quizExercise.setDueDate(ZonedDateTime.now()); - quizExercise.getQuizBatches().forEach(batch -> batch.setStartTime(quizBatchService.quizBatchStartDate(exercise, batch.getStartTime()))); - exerciseRepository.saveAndFlush(quizExercise); - - quizScheduleService.processCachedQuizSubmissions(); + for (int i = NUMBER_OF_STUDENTS / 2 + 1; i <= NUMBER_OF_STUDENTS; i++) { + quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, i, false, null); + quizSubmission.setSubmitted(true); + participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student" + i); + participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); + } - // after the quiz submissions have been processed, all submission are saved to the database + // all submission are saved to the database assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isEqualTo(NUMBER_OF_STUDENTS); - // Test the statistics directly from the database - QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); + // update the statistics + QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findByIdWithQuestionsAndStatisticsElseThrow(quizExercise.getId()); + quizStatisticService.recalculateStatistics(quizExerciseWithStatistic); + + // Test the statistics assertThat(quizExerciseWithStatistic).isNotNull(); assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsUnrated()).isZero(); assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsRated()).isEqualTo(NUMBER_OF_STUDENTS); @@ -193,11 +187,6 @@ else if (question instanceof DragAndDropQuestion) { assertThat(question.getQuizQuestionStatistic().getParticipantsRated()).isEqualTo(NUMBER_OF_STUDENTS); assertThat(question.getQuizQuestionStatistic().getParticipantsUnrated()).isZero(); } - - // execute the scheduler again, this should remove the quiz exercise from the cache - quizScheduleService.processCachedQuizSubmissions(); - // but of course keep all submissions - assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isEqualTo(NUMBER_OF_STUDENTS); } @Test @@ -259,14 +248,14 @@ void testQuizSubmit_partial_points() { submissions.add(student3Submission); for (int i = 0; i < 3; i++) { - var username = TEST_PREFIX + "student" + (i + 1); - final Principal principal = () -> username; - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), submissions.get(i), principal); + participationUtilService.addSubmission(quizExercise, submissions.get(i), TEST_PREFIX + "student" + (i + 1)); + participationUtilService.addResultToSubmission(submissions.get(i), AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(submissions.get(i)), true); } - quizScheduleService.processCachedQuizSubmissions(); + // update the statistics + QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findByIdWithQuestionsAndStatisticsElseThrow(quizExercise.getId()); + quizStatisticService.recalculateStatistics(quizExerciseWithStatistic); - QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); var quizPointStatistic = quizExerciseWithStatistic.getQuizPointStatistic(); assertThat(quizExerciseWithStatistic).isNotNull(); @@ -284,12 +273,11 @@ else if (pointCounter.getPoints() == 6.0) { else { assertThat(pointCounter.getRatedCounter()).as("All other buckets contain 0 rated submissions").isZero(); } - } } @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") - @WithMockUser(username = TEST_PREFIX + "student3", roles = "USER") + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") @EnumSource(QuizMode.class) void testQuizSubmitLiveMode(QuizMode quizMode) throws Exception { List courses = courseUtilService.createCoursesWithExercisesAndLectures(TEST_PREFIX, false, NUMBER_OF_TUTORS); @@ -302,17 +290,16 @@ void testQuizSubmitLiveMode(QuizMode quizMode) throws Exception { assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).isEmpty(); assertThat(participationRepository.findByExerciseId(quizExercise.getId())).isEmpty(); - int numberOfParticipants = 10; - + int numberOfParticipants = quizMode == QuizMode.SYNCHRONIZED ? 3 : 1; if (quizMode != QuizMode.SYNCHRONIZED) { var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusSeconds(10))); - for (int i = 1; i <= numberOfParticipants; i++) { - quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student" + i); - } + quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student1"); } for (int i = 1; i <= numberOfParticipants; i++) { - userUtilService.changeUser(TEST_PREFIX + "student" + i); + if (i > 1) { + userUtilService.changeUser(TEST_PREFIX + "student" + i); + } QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, i, false, null); assertThat(quizSubmission.getSubmittedAnswers()).hasSize(3); assertThat(quizSubmission.isSubmitted()).isFalse(); @@ -326,13 +313,6 @@ void testQuizSubmitLiveMode(QuizMode quizMode) throws Exception { // check whether submission date was set assertThat(updatedSubmission.getSubmissionDate()).isNotNull(); } - - // process cached submissions - quizScheduleService.processCachedQuizSubmissions(); - - // check whether all submissions were saved to the database - assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).hasSize(numberOfParticipants); - assertThat(participationRepository.findByExerciseId(quizExercise.getId())).hasSize(numberOfParticipants); } @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") @@ -425,15 +405,15 @@ void testQuizSubmitPractice(QuizMode quizMode) throws Exception { assertThat(((QuizSubmission) receivedResult.getSubmission()).getSubmittedAnswers()).hasSameSizeAs(quizSubmission.getSubmittedAnswers()); } - // after the quiz has ended, all submission are saved to the database + // all submission are saved to the database assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).hasSize(NUMBER_OF_STUDENTS); assertThat(participationRepository.findByExerciseId(quizExercise.getId())).hasSize(NUMBER_OF_STUDENTS); - // processing the quiz submissions will update the statistics - quizScheduleService.processCachedQuizSubmissions(); + // update the statistics + QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findByIdWithQuestionsAndStatisticsElseThrow(quizExercise.getId()); + quizStatisticService.recalculateStatistics(quizExerciseWithStatistic); - // Test the statistics directly from the database - QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); + // Test the statistics assertThat(quizExerciseWithStatistic).isNotNull(); assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsRated()).isZero(); assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsUnrated()).isEqualTo(NUMBER_OF_STUDENTS); @@ -618,11 +598,12 @@ void testQuizSubmitPreview(QuizMode quizMode) throws Exception { // in the preview the submission will not be saved to the database assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).isEmpty(); - quizScheduleService.processCachedQuizSubmissions(); + // update the statistics + QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findByIdWithQuestionsAndStatisticsElseThrow(quizExercise.getId()); + quizStatisticService.recalculateStatistics(quizExerciseWithStatistic); // all stats must be 0 because we have a preview here - // Test the statistics directly from the database - QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); + // Test the statistics assertThat(quizExerciseWithStatistic).isNotNull(); assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsRated()).isZero(); assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsUnrated()).isZero(); @@ -644,7 +625,7 @@ void testQuizSubmitPreview(QuizMode quizMode) throws Exception { } @Test - @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void testQuizSubmitScheduledAndDeleted() throws Exception { List courses = courseUtilService.createCoursesWithExercisesAndLectures(TEST_PREFIX, true, NUMBER_OF_TUTORS); Course course = courses.get(0); @@ -662,9 +643,7 @@ void testQuizSubmitScheduledAndDeleted() throws Exception { // check that submission fails QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, null); - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, () -> TEST_PREFIX + "student3"); - - quizScheduleService.processCachedQuizSubmissions(); + request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, Result.class, HttpStatus.BAD_REQUEST); assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isZero(); // reschedule @@ -677,42 +656,27 @@ void testQuizSubmitScheduledAndDeleted() throws Exception { assertThat(quizExercise.isQuizStarted()).isTrue(); assertThat(quizExercise.getQuizBatches()).allMatch(QuizBatch::isStarted); - // process cached submissions - quizScheduleService.processCachedQuizSubmissions(); - // save submissions for (int i = 1; i <= 2; i++) { quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, i, false, null); - final var username = TEST_PREFIX + "student" + i; - final Principal principal = () -> username; - // save - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); + participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student" + i); + participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); } - // process the saved but not submitted quiz submissions - quizScheduleService.processCachedQuizSubmissions(); - - // before the quiz submissions are submitted, none of them ends up in the database - assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isZero(); - // set the quiz end to now and ... log.debug("// End the quiz and delete it"); quizExercise = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); assertThat(quizExercise).isNotNull(); quizExercise.setDuration((int) Duration.between(quizExercise.getReleaseDate(), ZonedDateTime.now()).getSeconds() - Constants.QUIZ_GRACE_PERIOD_IN_SECONDS); quizExercise = exerciseRepository.saveAndFlush(quizExercise); - quizScheduleService.updateQuizExercise(quizExercise); - // ... directly delete the quiz - exerciseRepository.delete(quizExercise); + + // ...delete the quiz + request.delete("/api/quiz-exercises/" + quizExercise.getId(), HttpStatus.OK); QuizExercise finalQuizExercise = quizExercise; await().until(() -> exerciseRepository.findById(finalQuizExercise.getId()).isEmpty()); - // the deleted quiz should get removed, no submissions should be saved - quizScheduleService.processCachedQuizSubmissions(); - // quiz is not cached anymore - assertThat(quizScheduleService.getQuizExercise(quizExercise.getId())).isNull(); - // no submissions were marked as submitted and saved + // no submissions left assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isZero(); } @@ -729,18 +693,10 @@ void testQuizScoringTypes() { quizSubmission.addSubmittedAnswers(QuizExerciseFactory.generateSubmittedAnswerForQuizWithCorrectAndFalseAnswers(question)); } quizSubmission.submitted(true); - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, () -> TEST_PREFIX + "student4"); - - quizScheduleService.processCachedQuizSubmissions(); - - // End the quiz right now so that results can be processed - quizExercise = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); - assertThat(quizExercise).isNotNull(); - quizExercise.setDuration((int) Duration.between(quizExercise.getReleaseDate(), ZonedDateTime.now()).getSeconds() - Constants.QUIZ_GRACE_PERIOD_IN_SECONDS); - exerciseRepository.saveAndFlush(quizExercise); - - quizScheduleService.processCachedQuizSubmissions(); + participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student4"); + participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); + quizExerciseService.reEvaluate(quizExercise, quizExercise); assertThat(quizSubmissionRepository.findByQuizExerciseId(quizExercise.getId())).isPresent(); List results = resultRepository.findByParticipationExerciseIdOrderByCompletionDateAsc(quizExercise.getId()); @@ -779,18 +735,10 @@ void testQuizScoringType(ScoringType scoringType) { quizSubmission.addSubmittedAnswers(QuizExerciseFactory.generateSubmittedAnswerForQuizWithCorrectAndFalseAnswers(question)); } quizSubmission.submitted(true); - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, () -> TEST_PREFIX + "student5"); - - quizScheduleService.processCachedQuizSubmissions(); - - // End the quiz right now so that results can be processed - quizExercise = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId()); - assertThat(quizExercise).isNotNull(); - quizExercise.setDuration((int) Duration.between(quizExercise.getReleaseDate(), ZonedDateTime.now()).getSeconds() - Constants.QUIZ_GRACE_PERIOD_IN_SECONDS); - exerciseRepository.saveAndFlush(quizExercise); - - quizScheduleService.processCachedQuizSubmissions(); + participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student4"); + participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); + quizExerciseService.reEvaluate(quizExercise, quizExercise); assertThat(submissionRepository.countByExerciseIdSubmitted(quizExercise.getId())).isEqualTo(1); List results = resultRepository.findByParticipationExerciseIdOrderByCompletionDateAsc(quizExercise.getId()); From 4c6532cf211895d988370d5fa798d5af44cefd09 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:18:09 +0200 Subject: [PATCH 17/60] Remove additional console output and appender --- .../service/scheduled/cache/quiz/QuizCache.java | 6 ------ .../ParticipantScoreIntegrationTest.java | 1 - .../QuizExerciseIntegrationTest.java | 7 ------- .../QuizSubmissionIntegrationTest.java | 4 ---- .../LoggingDiscriminator.java | 16 ---------------- src/test/resources/logback.xml | 9 --------- 6 files changed, 43 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java b/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java index 9cccd263284b..e7c52ffacd8f 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java +++ b/src/main/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCache.java @@ -35,14 +35,10 @@ final class QuizCache extends CacheHandler { private final ITopic cachedQuizExerciseUpdates; - private final Long threadIdOnCreation; - public QuizCache(HazelcastInstance hazelcastInstance) { super(hazelcastInstance, Constants.HAZELCAST_EXERCISE_CACHE); this.cachedQuizExerciseUpdates = hazelcastInstance.getTopic(HAZELCAST_CACHED_EXERCISE_UPDATE_TOPIC); this.cachedQuizExerciseUpdates.addMessageListener(newQuizExerciseMessage -> updateQuizExerciseLocally(newQuizExerciseMessage.getMessageObject())); - this.threadIdOnCreation = Thread.currentThread().getId(); - System.out.println("Parallel Debug Info: QuizCache created in " + threadIdOnCreation); } /** @@ -104,7 +100,6 @@ void updateQuizExercise(QuizExercise quizExercise) { Objects.requireNonNull(quizExercise, "quizExercise must not be null"); // Send every instance (including itself) a message to update the quizExercise of the corresponding QuizExerciseCache locally cachedQuizExerciseUpdates.publish(quizExercise); - System.out.println("Parallel debug info: QuizCache updateQuizExercise in " + threadIdOnCreation + " -> " + Thread.currentThread().getId()); } /** @@ -115,6 +110,5 @@ void updateQuizExercise(QuizExercise quizExercise) { private void updateQuizExerciseLocally(QuizExercise quizExercise) { logger.debug("Quiz exercise {} updated in quiz exercise map: {}", quizExercise.getId(), quizExercise); getTransientWriteCacheFor(quizExercise.getId()).setExercise(quizExercise); - System.out.println("Parallel debug info: QuizCache updateQuizExerciseLocally in " + threadIdOnCreation + " -> " + Thread.currentThread().getId()); } } diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java index fabfced767ab..659ce2f38bb5 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java @@ -16,7 +16,6 @@ import org.springframework.security.test.context.support.WithMockUser; import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; -import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.competency.CompetencyUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.exam.Exam; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java index 78732c202602..2c1c87410bc6 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java @@ -42,7 +42,6 @@ import de.tum.in.www1.artemis.util.PageableSearchUtilService; import de.tum.in.www1.artemis.web.rest.dto.QuizBatchJoinDTO; import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO; -import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; class QuizExerciseIntegrationTest extends AbstractSpringIntegrationTest { @@ -53,9 +52,6 @@ class QuizExerciseIntegrationTest extends AbstractSpringIntegrationTest { @Autowired private QuizExerciseService quizExerciseService; - @Autowired - private QuizSubmissionWebsocketService quizSubmissionWebsocketService; - @Autowired private StudentParticipationRepository studentParticipationRepository; @@ -71,9 +67,6 @@ class QuizExerciseIntegrationTest extends AbstractSpringIntegrationTest { @Autowired private SubmittedAnswerRepository submittedAnswerRepository; - @Autowired - private QuizExerciseUtilService quizUtilService; - @Autowired private TeamRepository teamRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index c033cfd8e1d3..89e5145994b8 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -38,7 +38,6 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.service.QuizStatisticService; import de.tum.in.www1.artemis.user.UserUtilService; -import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { @@ -62,9 +61,6 @@ class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILoca @Autowired private QuizExerciseRepository quizExerciseRepository; - @Autowired - private QuizSubmissionWebsocketService quizSubmissionWebsocketService; - @Autowired private QuizSubmissionRepository quizSubmissionRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java index 43b21bea891e..89942338b3c9 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java @@ -20,16 +20,8 @@ public class LoggingDiscriminator implements Discriminator { private boolean isStarted; - private Long threadIdOnStart; - - public LoggingDiscriminator() { - threadIdOnStart = Thread.currentThread().getId(); - System.out.println("Parallel Debug Info: LoggingDiscriminator created in " + threadIdOnStart); - } - @Override public String getDiscriminatingValue(ILoggingEvent iLoggingEvent) { - System.out.println("Parallel Debug Info: LoggingDiscriminator.getDiscriminatingValue() called for " + threadIdOnStart); if (value.get() == null) { return DEFAULT; } @@ -44,13 +36,11 @@ public String getKey() { @Override public void start() { isStarted = true; - System.out.println("Parallel Debug Info: LoggingDiscriminator started in " + threadIdOnStart); } @Override public void stop() { isStarted = false; - System.out.println("Parallel Debug Info: LoggingDiscriminator stopped in " + threadIdOnStart); } @Override @@ -88,10 +78,4 @@ static Long getThreadId() { static TestGroup getTestGroup() { return testGroup.get(); } - - @Override - protected void finalize() throws Throwable { - System.out.println("Parallel Debug Info: LoggingDiscriminator finalized in " + threadIdOnStart); - super.finalize(); - } } diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml index 9a681b741d24..54c56fb48085 100644 --- a/src/test/resources/logback.xml +++ b/src/test/resources/logback.xml @@ -21,14 +21,6 @@ - - build/logs/allLogs.log - false - - %d{HH:mm:ss.SSS} | %3.3threadLocalId --> %3.3threadId == %9.9testGroup | %-16.16thread | %-5level | %-36.36logger{36} : %msg%n - - - @@ -63,7 +55,6 @@ WARN - From 8ad8c884802cd2ce00c18912bd787b6b25b38a94 Mon Sep 17 00:00:00 2001 From: lara Date: Wed, 23 Aug 2023 09:53:26 +0200 Subject: [PATCH 18/60] remove processCachedQuizSubmissions() from test --- .../ParticipationIntegrationTest.java | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java index c774c8d185d5..8014e87d8750 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java @@ -7,16 +7,13 @@ import java.time.ZonedDateTime; import java.util.*; import java.util.stream.IntStream; -import java.util.stream.Stream; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.EnumSource; -import org.junit.jupiter.params.provider.MethodSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; @@ -1289,17 +1286,14 @@ void getParticipation_notStudentInCourse() throws Exception { @ParameterizedTest @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") - @MethodSource("getGetParticipationsubmittedNotEndedQuizParameters") - void getParticipation_submittedNotEndedQuiz(QuizMode quizMode, boolean isSubmissionAllowed) throws Exception { - QuizExercise quizExercise = QuizExerciseFactory.generateQuizExercise(ZonedDateTime.now().minusMinutes(10), ZonedDateTime.now().plusMinutes(10), quizMode, course); + @EnumSource(QuizMode.class) + void testCheckQuizParticipation(QuizMode quizMode) throws Exception { + QuizExercise quizExercise = QuizExerciseFactory.generateQuizExercise(ZonedDateTime.now().minusMinutes(10), ZonedDateTime.now().minusMinutes(8), quizMode, course); quizExercise.addQuestions(QuizExerciseFactory.createShortAnswerQuestion()); quizExercise.setDuration(600); quizExercise.setQuizPointStatistic(new QuizPointStatistic()); quizExercise = exerciseRepo.save(quizExercise); - quizUtilService.prepareBatchForSubmitting(quizExercise, SecurityUtils.makeAuthorizationObject(TEST_PREFIX + "instructor1"), - SecurityContextHolder.getContext().getAuthentication()); - ShortAnswerQuestion saQuestion = (ShortAnswerQuestion) quizExercise.getQuizQuestions().get(0); List spots = saQuestion.getSpots(); ShortAnswerSubmittedAnswer submittedAnswer = new ShortAnswerSubmittedAnswer(); @@ -1312,24 +1306,15 @@ void getParticipation_submittedNotEndedQuiz(QuizMode quizMode, boolean isSubmiss QuizSubmission quizSubmission = new QuizSubmission(); quizSubmission.addSubmittedAnswers(submittedAnswer); - request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, QuizSubmission.class, HttpStatus.OK); - - quizScheduleService.processCachedQuizSubmissions(); - - if (!isSubmissionAllowed) { - // Duration is set to 0 so that QuizBatch.isSubmissionAllowed() will be false - quizExercise.setDuration(0); - quizExercise = exerciseRepo.save(quizExercise); - } + quizSubmission.submitted(true); + participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student1"); + participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); var actualParticipation = request.get("/api/exercises/" + quizExercise.getId() + "/participation", HttpStatus.OK, StudentParticipation.class); - assertThat(actualParticipation.getInitializationState()).isEqualTo(InitializationState.FINISHED); - var actualResults = actualParticipation.getResults(); assertThat(actualResults).hasSize(1); var actualSubmission = (QuizSubmission) actualResults.stream().findFirst().get().getSubmission(); - assertThat(actualSubmission.getType()).isEqualTo(SubmissionType.MANUAL); assertThat(actualSubmission.isSubmitted()).isTrue(); var actualSubmittedAnswers = actualSubmission.getSubmittedAnswers(); @@ -1343,9 +1328,4 @@ void getParticipation_submittedNotEndedQuiz(QuizMode quizMode, boolean isSubmiss assertThat(actualSubmittedAnswerText.getText()).isEqualTo("test"); assertThat(actualSubmittedAnswerText.isIsCorrect()).isFalse(); } - - private static Stream getGetParticipationsubmittedNotEndedQuizParameters() { - return Stream.of(Arguments.of(QuizMode.SYNCHRONIZED, true), Arguments.of(QuizMode.SYNCHRONIZED, false), Arguments.of(QuizMode.BATCHED, true), - Arguments.of(QuizMode.BATCHED, false), Arguments.of(QuizMode.INDIVIDUAL, true), Arguments.of(QuizMode.INDIVIDUAL, false)); - } } From 78729dde42fc6ee38686585034113668d89561ed Mon Sep 17 00:00:00 2001 From: lara Date: Wed, 23 Aug 2023 17:36:04 +0200 Subject: [PATCH 19/60] try fixing more tests --- .../QuizExerciseIntegrationTest.java | 19 ++++++++++++++----- .../QuizSubmissionIntegrationTest.java | 6 +++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java index 2c1c87410bc6..097a6f2051cb 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java @@ -900,12 +900,21 @@ void testPerformJoin(QuizMode quizMode, ZonedDateTime release, ZonedDateTime due SecurityContextHolder.getContext().setAuthentication(SecurityUtils.makeAuthorizationObject(TEST_PREFIX + "student1")); request.postWithResponseBody("/api/quiz-exercises/" + quizExercise.getId() + "/join", new QuizBatchJoinDTO(password), QuizBatch.class, result); - if (result == HttpStatus.OK) { - // if joining was successful repeating the request should fail, otherwise with the same reason as the first attempt - result = HttpStatus.BAD_REQUEST; - } + } - request.postWithResponseBody("/api/quiz-exercises/" + quizExercise.getId() + "/join", new QuizBatchJoinDTO(password), QuizBatch.class, result); + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + @EnumSource(QuizMode.class) + void testCannotPerformJoinTwice(QuizMode quizMode) throws Exception { + QuizExercise quizExercise = quizExerciseUtilService.createAndSaveQuiz(ZonedDateTime.now().minusMinutes(2), ZonedDateTime.now().plusMinutes(2), quizMode); + QuizBatch batch = new QuizBatch(); + batch.setStartTime(ZonedDateTime.now().minusMinutes(1)); + batch.setPassword("1234"); + + quizExerciseUtilService.setQuizBatchExerciseAndSave(batch, quizExercise); + quizScheduleService.joinQuizBatch(quizExercise, batch, userUtilService.getUserByLogin(TEST_PREFIX + "student1")); + + request.postWithResponseBody("/api/quiz-exercises/" + quizExercise.getId() + "/join", new QuizBatchJoinDTO("1234"), QuizBatch.class, HttpStatus.BAD_REQUEST); } /** diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 89e5145994b8..851712f79a79 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -350,9 +350,9 @@ void testQuizSubmitLiveMode_badRequest_alreadySubmitted(QuizMode quizMode) throw quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student5"); } - QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, false, ZonedDateTime.now()); - // submit quiz for the first time, expected status = OK - request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, Result.class, HttpStatus.OK); + // create a submission for the first time + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, ZonedDateTime.now()); + quizScheduleService.updateSubmission(quizExercise.getId(), TEST_PREFIX + "student5", quizSubmission); // submit quiz for the second time, expected status = BAD_REQUEST request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, Result.class, HttpStatus.BAD_REQUEST); } From 9784c304fb8741da4d2d3e4f1e0d7432982e1a73 Mon Sep 17 00:00:00 2001 From: lara Date: Wed, 23 Aug 2023 18:14:54 +0200 Subject: [PATCH 20/60] improve test --- .../QuizSubmissionIntegrationTest.java | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 851712f79a79..b96d5859dc94 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -276,9 +276,7 @@ else if (pointCounter.getPoints() == 6.0) { @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") @EnumSource(QuizMode.class) void testQuizSubmitLiveMode(QuizMode quizMode) throws Exception { - List courses = courseUtilService.createCoursesWithExercisesAndLectures(TEST_PREFIX, false, NUMBER_OF_TUTORS); - Course course = courses.get(0); - QuizExercise quizExercise = QuizExerciseFactory.createQuiz(course, ZonedDateTime.now().minusSeconds(10), null, quizMode); + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(2), null, quizMode); quizExercise.setDuration(600); quizExercise = quizExerciseService.save(quizExercise); @@ -286,29 +284,20 @@ void testQuizSubmitLiveMode(QuizMode quizMode) throws Exception { assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).isEmpty(); assertThat(participationRepository.findByExerciseId(quizExercise.getId())).isEmpty(); - int numberOfParticipants = quizMode == QuizMode.SYNCHRONIZED ? 3 : 1; if (quizMode != QuizMode.SYNCHRONIZED) { var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusSeconds(10))); quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student1"); } - for (int i = 1; i <= numberOfParticipants; i++) { - if (i > 1) { - userUtilService.changeUser(TEST_PREFIX + "student" + i); - } - QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, i, false, null); - assertThat(quizSubmission.getSubmittedAnswers()).hasSize(3); - assertThat(quizSubmission.isSubmitted()).isFalse(); - assertThat(quizSubmission.getSubmissionDate()).isNull(); - QuizSubmission updatedSubmission = request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, QuizSubmission.class, - HttpStatus.OK); - // check whether submission flag was updated - assertThat(updatedSubmission.isSubmitted()).isTrue(); - // check whether all answers were submitted properly - assertThat(updatedSubmission.getSubmittedAnswers()).hasSameSizeAs(quizSubmission.getSubmittedAnswers()); - // check whether submission date was set - assertThat(updatedSubmission.getSubmissionDate()).isNotNull(); - } + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, false, null); + QuizSubmission updatedSubmission = request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, QuizSubmission.class, + HttpStatus.OK); + // check whether submission flag was updated + assertThat(updatedSubmission.isSubmitted()).isTrue(); + // check whether all answers were submitted properly + assertThat(updatedSubmission.getSubmittedAnswers()).hasSameSizeAs(quizSubmission.getSubmittedAnswers()); + // check whether submission date was set + assertThat(updatedSubmission.getSubmissionDate()).isNotNull(); } @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") From c214939057732f1d1be620091770769cfa516340 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 24 Aug 2023 18:41:11 +0200 Subject: [PATCH 21/60] Implemented appender for parallel console logging --- .../LoggingDiscriminator.java | 81 ----------- .../LoggingExtension.java | 40 ------ .../ParallelConsoleAppender.java | 128 ++++++++++++++++++ .../ParallelLoggingExtension.java | 37 +++++ .../util/parallelTestExecution/TestGroup.java | 35 ----- .../TestGroupConverter.java | 16 --- .../ThreadLocalIdConverter.java | 12 -- .../org.junit.jupiter.api.extension.Extension | 2 +- src/test/resources/logback.xml | 21 +-- 9 files changed, 172 insertions(+), 200 deletions(-) delete mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java delete mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java create mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelLoggingExtension.java delete mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java delete mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java delete mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java deleted file mode 100644 index 89942338b3c9..000000000000 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingDiscriminator.java +++ /dev/null @@ -1,81 +0,0 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; - -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.sift.Discriminator; - -/** - * Discriminator that allows us to write the logs of each test method to a separate file. - */ -public class LoggingDiscriminator implements Discriminator { - - private static final String KEY = "logFileName"; - - private static final String DEFAULT = "unknown"; - - private static final InheritableThreadLocal value = new InheritableThreadLocal<>(); - - private static final InheritableThreadLocal threadId = new InheritableThreadLocal<>(); - - private static final InheritableThreadLocal testGroup = new InheritableThreadLocal<>(); - - private boolean isStarted; - - @Override - public String getDiscriminatingValue(ILoggingEvent iLoggingEvent) { - if (value.get() == null) { - return DEFAULT; - } - return value.get(); - } - - @Override - public String getKey() { - return KEY; - } - - @Override - public void start() { - isStarted = true; - } - - @Override - public void stop() { - isStarted = false; - } - - @Override - public boolean isStarted() { - return isStarted; - } - - /** - * Sets the value of the discriminator. - * - * @param newValue usually a combination of the test class name and test method name - */ - static void setValue(String newValue) { - value.set(newValue); - } - - static void setThreadId(Long newValue) { - threadId.set(newValue); - } - - static void setTestGroup(TestGroup newValue) { - testGroup.set(newValue); - } - - static void clear() { - threadId.remove(); - value.remove(); - testGroup.remove(); - } - - static Long getThreadId() { - return threadId.get(); - } - - static TestGroup getTestGroup() { - return testGroup.get(); - } -} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java deleted file mode 100644 index a25d2e3ac775..000000000000 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/LoggingExtension.java +++ /dev/null @@ -1,40 +0,0 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; - -import static org.awaitility.Awaitility.await; - -import java.io.File; -import java.time.Duration; - -import org.junit.jupiter.api.extension.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * JUnit 5 Extension that sets the value of the {@link LoggingDiscriminator} to a combination of the current test class name and test method name. - * This allows us to write the logs of each test instance to a separate file. - */ -public class LoggingExtension implements BeforeAllCallback, BeforeEachCallback, AfterAllCallback { - - private static final Logger log = LoggerFactory.getLogger(LoggingExtension.class); - - @Override - public void beforeAll(ExtensionContext context) { - File logFile = new File(context.getTestClass().orElseThrow().getSimpleName()); - LoggingDiscriminator.setValue(logFile.toString()); - LoggingDiscriminator.setTestGroup(TestGroup.fromClass(context.getRequiredTestClass())); - LoggingDiscriminator.setThreadId(Thread.currentThread().getId()); - - // Wait until the logger is initialized - await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger); - } - - @Override - public void beforeEach(ExtensionContext context) { - log.info("Starting test: {} > {}", context.getRequiredTestClass().getSimpleName(), context.getDisplayName()); - } - - @Override - public void afterAll(ExtensionContext extensionContext) throws Exception { - LoggingDiscriminator.clear(); - } -} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java new file mode 100644 index 000000000000..725767b8440e --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java @@ -0,0 +1,128 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import static org.assertj.core.api.Assertions.fail; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import javax.validation.constraints.NotNull; + +import ch.qos.logback.classic.encoder.PatternLayoutEncoder; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import de.tum.in.www1.artemis.*; +import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; + +public class ParallelConsoleAppender extends AppenderBase { + + private PatternLayoutEncoder encoder; + + private static final InheritableThreadLocal> localTestGroup = new InheritableThreadLocal<>(); + + private static final ConcurrentMap, List> testGroupToEncodedLogs = new ConcurrentHashMap<>(); + + @Override + protected synchronized void append(ILoggingEvent loggingEvent) { + Class testClass = localTestGroup.get(); + + // Add the logging Event to the corresponding List in the Map + if (testClass != null && !loggingEvent.getThreadName().contains("event")) { + List logs = testGroupToEncodedLogs.putIfAbsent(testClass, new ArrayList<>()); + if (logs == null) { + logs = testGroupToEncodedLogs.get(testClass); + } + logs.add(encoder.encode(loggingEvent)); + return; + } + + // If the thread id is not assigned to a TestGroup, we add the logging event for all active TestGroups + for (var logs : testGroupToEncodedLogs.values()) { + logs.add(encoder.encode(loggingEvent)); + } + } + + public static synchronized void printLogsForGroup(Class testClass) { + Class testGroupClass = TestGroup.fromClass(testClass); + List logs = testGroupToEncodedLogs.remove(testGroupClass); + if (logs == null) { + return; + } + + for (byte[] log : logs) { + System.out.writeBytes(log); + } + System.out.flush(); + } + + public static synchronized void addStringToLogsForGroup(String string) { + Class testClass = localTestGroup.get(); + + // Add the logging Event to the corresponding List in the Map + if (testClass != null) { + List logs = testGroupToEncodedLogs.putIfAbsent(testClass, new ArrayList<>()); + if (logs == null) { + logs = testGroupToEncodedLogs.get(testClass); + } + logs.add(string.getBytes()); + return; + } + + // If the thread id is not assigned to a TestGroup, we add the logging event for all active TestGroups + for (var logs : testGroupToEncodedLogs.values()) { + logs.add(string.getBytes()); + } + + } + + public static void registerActiveTestGroup(Class testClass) { + localTestGroup.set(TestGroup.fromClass(testClass)); + } + + public static void unregisterActiveTestGroup(Class testClass) { + testGroupToEncodedLogs.remove(testClass); + localTestGroup.remove(); + } + + // public Encoder getEncoder() { + // return encoder; + // } + + // Used by logback + public void setEncoder(PatternLayoutEncoder encoder) { + this.encoder = encoder; + } + + private enum TestGroup { + + BAMBOO_INTEGRATION_TEST(AbstractSpringIntegrationBambooBitbucketJiraTest.class), GITLAB_INTEGRATION_TEST(AbstractSpringIntegrationGitlabCIGitlabSamlTest.class), + JENKINS_INTEGRATION_TEST(AbstractSpringIntegrationJenkinsGitlabTest.class), LOCAL_INTEGRATION_TEST(AbstractSpringIntegrationLocalCILocalVCTest.class), + MIN_INTEGRATION_TEST(AbstractSpringIntegrationTest.class); + + @NotNull + private final Class clazz; + + TestGroup(Class clazz) { + this.clazz = clazz; + } + + public static Class fromClass(Class clazz) { + if (clazz == null) { + return null; + } + + for (TestGroup group : values()) { + if (group.clazz.isAssignableFrom(clazz)) { + return group.clazz; + } + } + + if (AbstractArtemisIntegrationTest.class.isAssignableFrom(clazz)) { + fail("Test class " + clazz.getName() + " extends ArtemisIntegrationTest but is not assigned to a test group"); + } + + return clazz; + } + } +} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelLoggingExtension.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelLoggingExtension.java new file mode 100644 index 000000000000..59730f1e1f8f --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelLoggingExtension.java @@ -0,0 +1,37 @@ +package de.tum.in.www1.artemis.util.parallelTestExecution; + +import static org.awaitility.Awaitility.await; + +import java.time.Duration; + +import org.junit.jupiter.api.extension.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ParallelLoggingExtension implements BeforeAllCallback, BeforeEachCallback, AfterAllCallback { + + @Override + public void beforeAll(ExtensionContext context) { + Class testClass = context.getRequiredTestClass(); + ParallelConsoleAppender.registerActiveTestGroup(testClass); + ParallelConsoleAppender.addStringToLogsForGroup("\nStarting logs for " + testClass.getSimpleName() + "\n"); + + // Wait until the logger is initialized + await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger); + } + + @Override + public void beforeEach(ExtensionContext context) throws Exception { + Class testClass = context.getRequiredTestClass(); + ParallelConsoleAppender.addStringToLogsForGroup("\n Starting logs for " + context.getRequiredTestClass().getSimpleName() + " > " + context.getDisplayName() + "\n"); + } + + @Override + public void afterAll(ExtensionContext context) throws Exception { + Class testClass = context.getRequiredTestClass(); + ParallelConsoleAppender.addStringToLogsForGroup("\nFinished logs for " + testClass.getSimpleName() + "\n"); + ParallelConsoleAppender.printLogsForGroup(testClass); + ParallelConsoleAppender.unregisterActiveTestGroup(testClass); + } + +} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java deleted file mode 100644 index 9e088b518d0b..000000000000 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroup.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; - -import de.tum.in.www1.artemis.*; -import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; - -public enum TestGroup { - - BAMBOO(AbstractSpringIntegrationBambooBitbucketJiraTest.class), GITLAB_CI(AbstractSpringIntegrationGitlabCIGitlabSamlTest.class), - JENKINS(AbstractSpringIntegrationJenkinsGitlabTest.class), LOCAL(AbstractSpringIntegrationLocalCILocalVCTest.class), SIMPLE(AbstractSpringIntegrationTest.class), - UNIT_TEST(null); - - private final Class clazz; - - TestGroup(Class clazz) { - this.clazz = clazz; - } - - public static TestGroup fromClass(Class clazz) { - if (clazz == null) { - return null; - } - - for (TestGroup group : values()) { - if (group.clazz != null && group.clazz.isAssignableFrom(clazz)) { - return group; - } - } - - if (AbstractArtemisIntegrationTest.class.isAssignableFrom(clazz)) { - throw new RuntimeException("Test class " + clazz.getName() + " extends ArtemisIntegrationTest but is not assigned to a test group"); - } - - return UNIT_TEST; - } -} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java deleted file mode 100644 index 622d5e037532..000000000000 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/TestGroupConverter.java +++ /dev/null @@ -1,16 +0,0 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; - -import ch.qos.logback.classic.pattern.ClassicConverter; -import ch.qos.logback.classic.spi.ILoggingEvent; - -public class TestGroupConverter extends ClassicConverter { - - @Override - public String convert(ILoggingEvent iLoggingEvent) { - TestGroup group = LoggingDiscriminator.getTestGroup(); - if (group == null) { - return ""; - } - return "" + LoggingDiscriminator.getTestGroup().name(); - } -} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java deleted file mode 100644 index 7a59a2e63209..000000000000 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadLocalIdConverter.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; - -import ch.qos.logback.classic.pattern.ClassicConverter; -import ch.qos.logback.classic.spi.ILoggingEvent; - -public class ThreadLocalIdConverter extends ClassicConverter { - - @Override - public String convert(ILoggingEvent iLoggingEvent) { - return "" + LoggingDiscriminator.getThreadId(); - } -} diff --git a/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension index 7015232f2e6f..00c7d0b747b2 100644 --- a/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension +++ b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -1 +1 @@ -de.tum.in.www1.artemis.util.parallelTestExecution.LoggingExtension +de.tum.in.www1.artemis.util.parallelTestExecution.ParallelLoggingExtension diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml index 54c56fb48085..cdcc88682502 100644 --- a/src/test/resources/logback.xml +++ b/src/test/resources/logback.xml @@ -5,20 +5,11 @@ - - - - - - - - build/logs/${logFileName}.log - false - - %d{HH:mm:ss.SSS} | %3.3threadLocalId --> %3.3threadId == %9.9testGroup | %-16.16thread | %-5level | %-36.36logger{36} : %msg%n - - - + + + + %16.16d{HH:mm:ss.SSS} | %3.3threadId %-16.16thread | %-5level | %-36.36logger{36} : %msg%n + @@ -54,7 +45,7 @@ WARN - + From 3b6b5dd155915a076aea8aa3bbe74db31b74e16d Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:54:13 +0200 Subject: [PATCH 22/60] Replaced List with ByteArrayOutputStream --- .../ParallelConsoleAppender.java | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java index 725767b8440e..3342bdac5d99 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java +++ b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java @@ -2,8 +2,7 @@ import static org.assertj.core.api.Assertions.fail; -import java.util.ArrayList; -import java.util.List; +import java.io.ByteArrayOutputStream; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -21,7 +20,7 @@ public class ParallelConsoleAppender extends AppenderBase { private static final InheritableThreadLocal> localTestGroup = new InheritableThreadLocal<>(); - private static final ConcurrentMap, List> testGroupToEncodedLogs = new ConcurrentHashMap<>(); + private static final ConcurrentMap, ByteArrayOutputStream> testGroupToEncodedLogs = new ConcurrentHashMap<>(); @Override protected synchronized void append(ILoggingEvent loggingEvent) { @@ -29,30 +28,32 @@ protected synchronized void append(ILoggingEvent loggingEvent) { // Add the logging Event to the corresponding List in the Map if (testClass != null && !loggingEvent.getThreadName().contains("event")) { - List logs = testGroupToEncodedLogs.putIfAbsent(testClass, new ArrayList<>()); - if (logs == null) { - logs = testGroupToEncodedLogs.get(testClass); + if (testGroupToEncodedLogs.containsKey(testClass)) { + testGroupToEncodedLogs.get(testClass).writeBytes(encoder.encode(loggingEvent)); + } + else { + ByteArrayOutputStream logs = new ByteArrayOutputStream(); + logs.writeBytes(encoder.encode(loggingEvent)); + testGroupToEncodedLogs.put(testClass, logs); } - logs.add(encoder.encode(loggingEvent)); return; } // If the thread id is not assigned to a TestGroup, we add the logging event for all active TestGroups - for (var logs : testGroupToEncodedLogs.values()) { - logs.add(encoder.encode(loggingEvent)); + for (ByteArrayOutputStream logs : testGroupToEncodedLogs.values()) { + logs.writeBytes(encoder.encode(loggingEvent)); } } public static synchronized void printLogsForGroup(Class testClass) { Class testGroupClass = TestGroup.fromClass(testClass); - List logs = testGroupToEncodedLogs.remove(testGroupClass); + ByteArrayOutputStream logs = testGroupToEncodedLogs.remove(testGroupClass); if (logs == null) { return; } - for (byte[] log : logs) { - System.out.writeBytes(log); - } + System.out.writeBytes(logs.toByteArray()); + logs.reset(); System.out.flush(); } @@ -61,17 +62,20 @@ public static synchronized void addStringToLogsForGroup(String string) { // Add the logging Event to the corresponding List in the Map if (testClass != null) { - List logs = testGroupToEncodedLogs.putIfAbsent(testClass, new ArrayList<>()); - if (logs == null) { - logs = testGroupToEncodedLogs.get(testClass); + if (testGroupToEncodedLogs.containsKey(testClass)) { + testGroupToEncodedLogs.get(testClass).writeBytes(string.getBytes()); + } + else { + ByteArrayOutputStream logs = new ByteArrayOutputStream(); + logs.writeBytes(string.getBytes()); + testGroupToEncodedLogs.put(testClass, logs); } - logs.add(string.getBytes()); return; } // If the thread id is not assigned to a TestGroup, we add the logging event for all active TestGroups - for (var logs : testGroupToEncodedLogs.values()) { - logs.add(string.getBytes()); + for (ByteArrayOutputStream logs : testGroupToEncodedLogs.values()) { + logs.writeBytes(string.getBytes()); } } @@ -85,10 +89,6 @@ public static void unregisterActiveTestGroup(Class testClass) { localTestGroup.remove(); } - // public Encoder getEncoder() { - // return encoder; - // } - // Used by logback public void setEncoder(PatternLayoutEncoder encoder) { this.encoder = encoder; From 8521f1ecdcfba3a400a769a388d432701c53b258 Mon Sep 17 00:00:00 2001 From: lara Date: Fri, 25 Aug 2023 18:13:42 +0200 Subject: [PATCH 23/60] fix testQuizSubmitLiveMode_badRequest_alreadySubmitted after merge --- .../exercise/quizexercise/QuizSubmissionIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 7a006fde5946..3ab976709533 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -337,7 +337,7 @@ void testQuizSubmitLiveMode_badRequest_alreadySubmitted(QuizMode quizMode) throw // create a submission for the first time QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, ZonedDateTime.now()); - quizScheduleService.updateSubmission(quizExercise.getId(), TEST_PREFIX + "student5", quizSubmission); + quizScheduleService.updateSubmission(quizExercise.getId(), TEST_PREFIX + "student3", quizSubmission); // submit quiz for the second time, expected status = BAD_REQUEST request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, Result.class, HttpStatus.BAD_REQUEST); } From 14aa19c5dfde3a077a2ffbf2ae093fa0a1f25856 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 25 Aug 2023 23:34:20 +0200 Subject: [PATCH 24/60] Create flaky_test_detection.sh --- supporting_scripts/flaky_test_detection.sh | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 supporting_scripts/flaky_test_detection.sh diff --git a/supporting_scripts/flaky_test_detection.sh b/supporting_scripts/flaky_test_detection.sh new file mode 100644 index 000000000000..5705d0d5ad9f --- /dev/null +++ b/supporting_scripts/flaky_test_detection.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# Check for the number of test runs argument. +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Get the number of test runs from the command line argument. +NUM_RUNS="$1" + +# Define spring profiles. +SPRING_PROFILES=("none" "mysql" "postgres") + +# Create the 'supporting_scripts/test-results' directory, if it doesn't exist. +mkdir -p supporting_scripts/test-results + +for ((run = 1; run <= NUM_RUNS; run++)); do + # Generate a random number between 1 and 13. + spring_profile_chance=$((RANDOM % 13 + 1)) + + # Determine the active spring profile based on the random number 10/13 chance of no profile, 2/13 chance of MYSQL, 1/13 chance of POSTGRES. + profile_index=0 + if [[ $spring_profile_chance -gt 10 ]]; then + profile_index=1 + fi + + if [[ $spring_profile_chance -gt 12 ]]; then + profile_index=2 + fi + active_profile="${SPRING_PROFILES[$profile_index]}" + + # Generate a random number of maximum concurrent tests between 1 and 6 + max_concurrent_tests=$((RANDOM % 6 + 1)) + + # Generate output file name + TIME=$(date +"%Y-%m-%d_%H:%M:%S") + output_file="${active_profile}_${TIME}_threads${max_concurrent_tests}_run${run}.log" + + # Run tests with gradlew + echo "Running tests with Spring Profile: $active_profile, Threads: $max_concurrent_tests (Run $run)" + set -o pipefail && SPRING_PROFILES_INCLUDE="$active_profile" ./gradlew --console=plain \ + -Djunit.jupiter.execution.parallel.config.fixed.parallelism="$max_concurrent_tests" \ + test --rerun jacocoTestReport -x webapp jacocoTestCoverageVerification > "./supporting_scripts/test-results/$output_file" + + # Check if tests were successful + if grep -q "BUILD SUCCESSFUL" "./supporting_scripts/test-results/$output_file"; then + # TODO: Remove file, if the test run was successful + mv "./supporting_scripts/test-results/$output_file" "./supporting_scripts/test-results/SUCCESS_${output_file}" + else + mv "./supporting_scripts/test-results/$output_file" "./supporting_scripts/test-results/FAILURE_${output_file}" + fi + + # Wait a bit before the next run + sleep 10 +done + +# TODO: Create a summary of failing tests, including the number of times they failed and the corresponding file names + +echo "Tests completed for $NUM_RUNS run(s)." From 348f3da8023af1d7f8abaa4d34dfff6715bd736f Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 28 Aug 2023 19:45:24 +0200 Subject: [PATCH 25/60] Add summary for flaky test detection --- supporting_scripts/flaky_test_detection.sh | 55 +++++++++++++++------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/supporting_scripts/flaky_test_detection.sh b/supporting_scripts/flaky_test_detection.sh index 5705d0d5ad9f..ec941b0b240e 100644 --- a/supporting_scripts/flaky_test_detection.sh +++ b/supporting_scripts/flaky_test_detection.sh @@ -12,14 +12,22 @@ NUM_RUNS="$1" # Define spring profiles. SPRING_PROFILES=("none" "mysql" "postgres") -# Create the 'supporting_scripts/test-results' directory, if it doesn't exist. -mkdir -p supporting_scripts/test-results +DIRECTORY='./build/flaky-test-detection-results' + +# Create the directory, if it doesn't exist. +mkdir -p ${DIRECTORY} + +# ==================== # +# FLAKY TEST DETECTION # +# ==================== # for ((run = 1; run <= NUM_RUNS; run++)); do # Generate a random number between 1 and 13. spring_profile_chance=$((RANDOM % 13 + 1)) - # Determine the active spring profile based on the random number 10/13 chance of no profile, 2/13 chance of MYSQL, 1/13 chance of POSTGRES. + # Determine the active spring profile based on the random number: + # 10/13 chance of no profile, 2/13 chance of MYSQL, 1/13 chance of POSTGRES. + # (Should result in similar execution times for each profile). profile_index=0 if [[ $spring_profile_chance -gt 10 ]]; then profile_index=1 @@ -30,31 +38,46 @@ for ((run = 1; run <= NUM_RUNS; run++)); do fi active_profile="${SPRING_PROFILES[$profile_index]}" - # Generate a random number of maximum concurrent tests between 1 and 6 - max_concurrent_tests=$((RANDOM % 6 + 1)) - # Generate output file name TIME=$(date +"%Y-%m-%d_%H:%M:%S") - output_file="${active_profile}_${TIME}_threads${max_concurrent_tests}_run${run}.log" + output_file="${active_profile}_${TIME}_run${run}.log" # Run tests with gradlew - echo "Running tests with Spring Profile: $active_profile, Threads: $max_concurrent_tests (Run $run)" + echo "Running tests with Spring Profile: $active_profile (Run $run)" set -o pipefail && SPRING_PROFILES_INCLUDE="$active_profile" ./gradlew --console=plain \ - -Djunit.jupiter.execution.parallel.config.fixed.parallelism="$max_concurrent_tests" \ - test --rerun jacocoTestReport -x webapp jacocoTestCoverageVerification > "./supporting_scripts/test-results/$output_file" + test --rerun jacocoTestReport -x webapp jacocoTestCoverageVerification > "${DIRECTORY}/$output_file" - # Check if tests were successful - if grep -q "BUILD SUCCESSFUL" "./supporting_scripts/test-results/$output_file"; then - # TODO: Remove file, if the test run was successful - mv "./supporting_scripts/test-results/$output_file" "./supporting_scripts/test-results/SUCCESS_${output_file}" + # Check if tests were successful. If not, rename the output file to indicate failure. Delete the output file if tests were successful. + if grep -q "BUILD SUCCESSFUL" "${DIRECTORY}/$output_file"; then + rm "${DIRECTORY}/$output_file" else - mv "./supporting_scripts/test-results/$output_file" "./supporting_scripts/test-results/FAILURE_${output_file}" + mv "${DIRECTORY}/$output_file" "${DIRECTORY}/FAILURE_${output_file}" fi # Wait a bit before the next run sleep 10 done -# TODO: Create a summary of failing tests, including the number of times they failed and the corresponding file names +# ================== # +# FLAKY TEST SUMMARY # +# ================== # + +echo "Generating flaky test summary..." + +SUMMARY_DIRECTORY="${DIRECTORY}/summary" +mkdir -p "$SUMMARY_DIRECTORY" + +SUMMARY_FILE="${SUMMARY_DIRECTORY}/run-summary.txt" +printf "Logfile and Failed Tests\n" > "$SUMMARY_FILE" +for file in "$DIRECTORY"/*.log; do + if [ -f "$file" ]; then + printf "\nFailed tests in $(basename "$file"):\n" >> "$SUMMARY_FILE" + grep "Test >.* FAILED" "$file" >> "$SUMMARY_FILE" + fi +done + +COUNT_FILE="${SUMMARY_DIRECTORY}/failure-count.txt" +printf "Count of Failed Tests\n" > "$COUNT_FILE" +grep "Test >.* FAILED" "$SUMMARY_FILE" | sort | uniq -c | sort -nr >> "$COUNT_FILE" echo "Tests completed for $NUM_RUNS run(s)." From 154a2e92cb9cb567f1bba293e9fd6cc1c87a8403 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 28 Aug 2023 19:54:24 +0200 Subject: [PATCH 26/60] Fix LongFeedbackResourceIntegrationTest --- .../in/www1/artemis/LongFeedbackResourceIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java index ef9a12a8c581..b1e43c1b07b5 100644 --- a/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java @@ -49,7 +49,7 @@ void getLongFeedbackAsStudent() throws Exception { final Feedback feedback = addLongFeedbackToResult(resultStudent1); final LongFeedbackText longFeedbackText = request.get(getUrl(resultStudent1.getId(), feedback.getId()), HttpStatus.OK, LongFeedbackText.class); - assertThat(longFeedbackText.getId()).isEqualTo(feedback.getId()); + assertThat(longFeedbackText.getFeedback().getId()).isEqualTo(feedback.getId()); } @Test @@ -58,7 +58,7 @@ void getLongFeedbackAsTutor() throws Exception { final Feedback feedback = addLongFeedbackToResult(resultStudent1); final LongFeedbackText longFeedbackText = request.get(getUrl(resultStudent1.getId(), feedback.getId()), HttpStatus.OK, LongFeedbackText.class); - assertThat(longFeedbackText.getId()).isEqualTo(feedback.getId()); + assertThat(longFeedbackText.getFeedback().getId()).isEqualTo(feedback.getId()); } @Test From 96ef0946082d6cdc902126b7126602998590710d Mon Sep 17 00:00:00 2001 From: lara Date: Tue, 29 Aug 2023 10:07:33 +0200 Subject: [PATCH 27/60] fix rateNotActivatedHintForAnExerciseForbidden() --- .../in/www1/artemis/hestia/ExerciseHintIntegrationTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java index 4a3fed1455d0..acfc631fd2c8 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java @@ -193,9 +193,10 @@ void rateActivatedHintForAnExerciseBadRequest() throws Exception { @Test @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") void rateNotActivatedHintForAnExerciseForbidden() throws Exception { + long sizeBefore = exerciseHintActivationRepository.count(); request.postWithoutLocation("/api/programming-exercises/" + exercise.getId() + "/exercise-hints/" + exerciseHint.getId() + "/rating/" + 4, null, HttpStatus.NOT_FOUND, null); - assertThat(exerciseHintActivationRepository.count()).isZero(); + assertThat(exerciseHintActivationRepository.count()).isEqualTo(sizeBefore); } @Test From d81213723b5a1cbac73dab2b24a96132228c7285 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:28:29 +0200 Subject: [PATCH 28/60] Fix NotificationResourceIntegrationTest --- .../notification/NotificationResourceIntegrationTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java index 71c5d4a8cd56..7ed4c76aefad 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java @@ -61,6 +61,7 @@ void initTestCase() { course1 = textExerciseUtilService.addCourseWithOneReleasedTextExercise(); course2 = textExerciseUtilService.addCourseWithOneReleasedTextExercise(); systemNotificationRepository.deleteAll(); + notificationRepository.deleteAll(); User student1 = userUtilService.getUserByLogin(TEST_PREFIX + "student1"); student1.setLastNotificationRead(ZonedDateTime.now().minusDays(1)); From aef3c4bbe5c6dfeaa200f5f7384e0e01c700cf82 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 31 Aug 2023 20:58:21 +0200 Subject: [PATCH 29/60] Fix submitComplaintResponse_examExercise() --- .../assessment/AssessmentComplaintIntegrationTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java index dd70a8e165fe..7d7aa211f80d 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java @@ -8,7 +8,6 @@ import java.time.temporal.ChronoUnit; import java.util.List; import java.util.Optional; -import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -365,8 +364,12 @@ void submitComplaintResponse_examExercise() throws Exception { complaintResponse.setResponseText("abcdefghijklmnopqrstuvwxyz"); request.putWithResponseBody("/api/complaint-responses/complaint/" + examExerciseComplaint.getId() + "/resolve", complaintResponse, ComplaintResponse.class, HttpStatus.OK); - TextSubmission finalTextSubmission = textSubmission; - await().timeout(10, TimeUnit.SECONDS).untilAsserted(() -> assertThat(complaintRepo.findByResultId(finalTextSubmission.getId())).isPresent()); + + assertThat(textSubmission.getLatestResult()).isNotNull(); + assertThat(complaintRepo.findByResultId(textSubmission.getLatestResult().getId())).isPresent(); + + Complaint finalExamExerciseComplaint = examExerciseComplaint; + await().untilAsserted(() -> assertThat(complaintResponseRepo.findByComplaint_Id(finalExamExerciseComplaint.getId())).isPresent()); } @Test From ae58c10790f1b524ef3c1715528183a29300d00d Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Sat, 2 Sep 2023 16:46:25 +0200 Subject: [PATCH 30/60] Fix CourseServiceTest after merge --- .../de/tum/in/www1/artemis/service/CourseServiceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java index 942c62c76385..130b122237b4 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/CourseServiceTest.java @@ -17,7 +17,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextSubmission; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.service.ldap.LdapUserDto; import de.tum.in.www1.artemis.user.UserUtilService; -class CourseServiceTest extends AbstractSpringIntegrationTest { +class CourseServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest { private static final String TEST_PREFIX = "courseservice"; From 91721656a248c2827f5708dcb26c5c02692020be Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Sat, 2 Sep 2023 17:33:15 +0200 Subject: [PATCH 31/60] Added documentation for logging utils --- .../AbstractSpringIntegrationTest.java | 7 +- .../ParallelLoggingExtension.java | 17 +++-- .../ParallelConsoleAppender.java | 65 ++++++++++++++----- .../ThreadIdConverter.java | 17 +++++ .../ThreadIdConverter.java | 12 ---- .../org.junit.jupiter.api.extension.Extension | 2 +- src/test/resources/logback.xml | 4 +- 7 files changed, 81 insertions(+), 43 deletions(-) rename src/test/java/de/tum/in/www1/artemis/util/{parallelTestExecution => junit_extensions}/ParallelLoggingExtension.java (64%) rename src/test/java/de/tum/in/www1/artemis/util/{parallelTestExecution => junit_parallel_logging}/ParallelConsoleAppender.java (61%) create mode 100644 src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ThreadIdConverter.java delete mode 100644 src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java index 0c889f2836ae..79a7a8c6324c 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -27,6 +27,9 @@ import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; +/** + * This SpringBootTest is used for tests that only require a minimal set of Active Spring Profiles. + */ @Order(3) @SpringBootTest @AutoConfigureMockMvc @@ -46,10 +49,6 @@ protected void resetSpyBeans() { super.resetSpyBeans(); } - /** - * Note: This test group is used for tests that do not require to mock requests to the VC and CI server. - */ - @Override public void mockConnectorRequestsForSetup(ProgrammingExercise exercise, boolean failToCreateCiProject) { log.debug("Called mockConnectorRequestsForSetup with args {}, {}", exercise, failToCreateCiProject); diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelLoggingExtension.java b/src/test/java/de/tum/in/www1/artemis/util/junit_extensions/ParallelLoggingExtension.java similarity index 64% rename from src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelLoggingExtension.java rename to src/test/java/de/tum/in/www1/artemis/util/junit_extensions/ParallelLoggingExtension.java index 59730f1e1f8f..12da0d403cb0 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelLoggingExtension.java +++ b/src/test/java/de/tum/in/www1/artemis/util/junit_extensions/ParallelLoggingExtension.java @@ -1,13 +1,19 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; +package de.tum.in.www1.artemis.util.junit_extensions; import static org.awaitility.Awaitility.await; -import java.time.Duration; - import org.junit.jupiter.api.extension.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import de.tum.in.www1.artemis.util.junit_parallel_logging.ParallelConsoleAppender; + +/** + * A JUnit 5 extension that uses {@link ParallelConsoleAppender} to collect logs from parallel test execution. + *

+ * This extension is used to add structural information to the logs, e.g. to indicate the start and end of a test class. At the end of the test class, the collected logs from + * {@link ParallelConsoleAppender} get printed to the console. + */ public class ParallelLoggingExtension implements BeforeAllCallback, BeforeEachCallback, AfterAllCallback { @Override @@ -17,17 +23,16 @@ public void beforeAll(ExtensionContext context) { ParallelConsoleAppender.addStringToLogsForGroup("\nStarting logs for " + testClass.getSimpleName() + "\n"); // Wait until the logger is initialized - await().pollDelay(Duration.ZERO).pollInterval(Duration.ofMillis(2)).until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger); + await().until(() -> LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger); } @Override public void beforeEach(ExtensionContext context) throws Exception { - Class testClass = context.getRequiredTestClass(); ParallelConsoleAppender.addStringToLogsForGroup("\n Starting logs for " + context.getRequiredTestClass().getSimpleName() + " > " + context.getDisplayName() + "\n"); } @Override - public void afterAll(ExtensionContext context) throws Exception { + public void afterAll(ExtensionContext context) { Class testClass = context.getRequiredTestClass(); ParallelConsoleAppender.addStringToLogsForGroup("\nFinished logs for " + testClass.getSimpleName() + "\n"); ParallelConsoleAppender.printLogsForGroup(testClass); diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java similarity index 61% rename from src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java rename to src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java index 3342bdac5d99..0d901dbde489 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ParallelConsoleAppender.java +++ b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java @@ -1,4 +1,4 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; +package de.tum.in.www1.artemis.util.junit_parallel_logging; import static org.assertj.core.api.Assertions.fail; @@ -18,36 +18,42 @@ public class ParallelConsoleAppender extends AppenderBase { private PatternLayoutEncoder encoder; - private static final InheritableThreadLocal> localTestGroup = new InheritableThreadLocal<>(); + private static final InheritableThreadLocal> LOCAL_TEST_GROUP = new InheritableThreadLocal<>(); - private static final ConcurrentMap, ByteArrayOutputStream> testGroupToEncodedLogs = new ConcurrentHashMap<>(); + private static final ConcurrentMap, ByteArrayOutputStream> TEST_GROUP_TO_ENCODED_LOGS = new ConcurrentHashMap<>(); @Override protected synchronized void append(ILoggingEvent loggingEvent) { - Class testClass = localTestGroup.get(); + Class testClass = LOCAL_TEST_GROUP.get(); // Add the logging Event to the corresponding List in the Map if (testClass != null && !loggingEvent.getThreadName().contains("event")) { - if (testGroupToEncodedLogs.containsKey(testClass)) { - testGroupToEncodedLogs.get(testClass).writeBytes(encoder.encode(loggingEvent)); + if (TEST_GROUP_TO_ENCODED_LOGS.containsKey(testClass)) { + TEST_GROUP_TO_ENCODED_LOGS.get(testClass).writeBytes(encoder.encode(loggingEvent)); } else { ByteArrayOutputStream logs = new ByteArrayOutputStream(); logs.writeBytes(encoder.encode(loggingEvent)); - testGroupToEncodedLogs.put(testClass, logs); + TEST_GROUP_TO_ENCODED_LOGS.put(testClass, logs); } return; } // If the thread id is not assigned to a TestGroup, we add the logging event for all active TestGroups - for (ByteArrayOutputStream logs : testGroupToEncodedLogs.values()) { + for (ByteArrayOutputStream logs : TEST_GROUP_TO_ENCODED_LOGS.values()) { logs.writeBytes(encoder.encode(loggingEvent)); } } + /** + * Prints the logs for the given test group to the console and removes them. + * This method should be called at the end of a test class. + * + * @param testClass the test's class for which the logs should be printed + */ public static synchronized void printLogsForGroup(Class testClass) { Class testGroupClass = TestGroup.fromClass(testClass); - ByteArrayOutputStream logs = testGroupToEncodedLogs.remove(testGroupClass); + ByteArrayOutputStream logs = TEST_GROUP_TO_ENCODED_LOGS.remove(testGroupClass); if (logs == null) { return; } @@ -57,39 +63,62 @@ public static synchronized void printLogsForGroup(Class testClass) { System.out.flush(); } + /** + * Adds the given string to the logs for the current test group. + * + * @param string the string to add to the logs + */ public static synchronized void addStringToLogsForGroup(String string) { - Class testClass = localTestGroup.get(); + Class testClass = LOCAL_TEST_GROUP.get(); // Add the logging Event to the corresponding List in the Map if (testClass != null) { - if (testGroupToEncodedLogs.containsKey(testClass)) { - testGroupToEncodedLogs.get(testClass).writeBytes(string.getBytes()); + if (TEST_GROUP_TO_ENCODED_LOGS.containsKey(testClass)) { + TEST_GROUP_TO_ENCODED_LOGS.get(testClass).writeBytes(string.getBytes()); } else { ByteArrayOutputStream logs = new ByteArrayOutputStream(); logs.writeBytes(string.getBytes()); - testGroupToEncodedLogs.put(testClass, logs); + TEST_GROUP_TO_ENCODED_LOGS.put(testClass, logs); } return; } // If the thread id is not assigned to a TestGroup, we add the logging event for all active TestGroups - for (ByteArrayOutputStream logs : testGroupToEncodedLogs.values()) { + for (ByteArrayOutputStream logs : TEST_GROUP_TO_ENCODED_LOGS.values()) { logs.writeBytes(string.getBytes()); } } + /** + * Registers the test group for the given test class. + * This method should be called at the beginning of a test class. + * + * @param testClass the test's class + */ public static void registerActiveTestGroup(Class testClass) { - localTestGroup.set(TestGroup.fromClass(testClass)); + LOCAL_TEST_GROUP.set(TestGroup.fromClass(testClass)); } + /** + * Unregisters the test group for the given test class. + * This method should be called at the end of a test class. + * + * @param testClass the test's class + */ public static void unregisterActiveTestGroup(Class testClass) { - testGroupToEncodedLogs.remove(testClass); - localTestGroup.remove(); + TEST_GROUP_TO_ENCODED_LOGS.remove(testClass); + LOCAL_TEST_GROUP.remove(); } - // Used by logback + /** + * Sets the encoder for this appender. This method is used by logback and should not be removed. + * This method is used to set the encoder's pattern in the logback.xml file. + * + * @param encoder the encoder used to encode the logging events + */ + @SuppressWarnings("unused") public void setEncoder(PatternLayoutEncoder encoder) { this.encoder = encoder; } diff --git a/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ThreadIdConverter.java b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ThreadIdConverter.java new file mode 100644 index 000000000000..cfd9d1653db7 --- /dev/null +++ b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ThreadIdConverter.java @@ -0,0 +1,17 @@ +package de.tum.in.www1.artemis.util.junit_parallel_logging; + +import ch.qos.logback.classic.pattern.ClassicConverter; +import ch.qos.logback.classic.spi.ILoggingEvent; + +/** + * A custom Logback converter that can be used to display the thread id in the logs. + *

+ * This converter is used to distinguish logs from different threads when running tests in parallel. + */ +public class ThreadIdConverter extends ClassicConverter { + + @Override + public String convert(ILoggingEvent iLoggingEvent) { + return String.valueOf(Thread.currentThread().getId()); + } +} diff --git a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java b/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java deleted file mode 100644 index b396ec924269..000000000000 --- a/src/test/java/de/tum/in/www1/artemis/util/parallelTestExecution/ThreadIdConverter.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.tum.in.www1.artemis.util.parallelTestExecution; - -import ch.qos.logback.classic.pattern.ClassicConverter; -import ch.qos.logback.classic.spi.ILoggingEvent; - -public class ThreadIdConverter extends ClassicConverter { - - @Override - public String convert(ILoggingEvent iLoggingEvent) { - return "" + Thread.currentThread().getId(); - } -} diff --git a/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension index 7f2e5990d36b..8dfc3c5b68c1 100644 --- a/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension +++ b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -1,2 +1,2 @@ de.tum.in.www1.artemis.util.junit_extensions.AwaitilityExtension -de.tum.in.www1.artemis.util.parallelTestExecution.ParallelLoggingExtension +de.tum.in.www1.artemis.util.junit_extensions.ParallelLoggingExtension diff --git a/src/test/resources/logback.xml b/src/test/resources/logback.xml index cdcc88682502..f51816ce443b 100644 --- a/src/test/resources/logback.xml +++ b/src/test/resources/logback.xml @@ -4,9 +4,9 @@ - + - + %16.16d{HH:mm:ss.SSS} | %3.3threadId %-16.16thread | %-5level | %-36.36logger{36} : %msg%n From ba088f6c6bda1b89a68775e83cbb661a0fc4ed60 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:36:44 +0200 Subject: [PATCH 32/60] Make AbstractSpringIntegrationTest abstract --- .../de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java index 79a7a8c6324c..05d9bebabbf4 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -40,7 +40,7 @@ // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "scheduling" }) @TestPropertySource(properties = { "artemis.user-management.use-external=false" }) -public class AbstractSpringIntegrationTest extends AbstractArtemisIntegrationTest { +public abstract class AbstractSpringIntegrationTest extends AbstractArtemisIntegrationTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); From 5e472d515fbd5640d91502ac6ed83a3ae272813e Mon Sep 17 00:00:00 2001 From: lara Date: Wed, 13 Sep 2023 18:16:08 +0200 Subject: [PATCH 33/60] fix quiz participation test --- .../participation/ParticipationIntegrationTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java index a2d14ffed548..b84419f0390d 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java @@ -18,7 +18,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; @@ -42,9 +41,9 @@ import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseFactory; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; import de.tum.in.www1.artemis.repository.*; -import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.service.GradingScaleService; import de.tum.in.www1.artemis.service.ParticipationService; +import de.tum.in.www1.artemis.service.QuizBatchService; import de.tum.in.www1.artemis.service.feature.Feature; import de.tum.in.www1.artemis.service.feature.FeatureToggleService; import de.tum.in.www1.artemis.service.scheduled.cache.quiz.QuizScheduleService; @@ -80,7 +79,7 @@ class ParticipationIntegrationTest extends AbstractSpringIntegrationBambooBitbuc private ParticipationService participationService; @Autowired - private QuizExerciseUtilService quizUtilService; + private QuizBatchService quizBatchService; @Autowired protected QuizScheduleService quizScheduleService; @@ -1239,8 +1238,11 @@ void getParticipation_quizExerciseStartedAndNoParticipation(QuizMode quizMode) t void getParticipation_quizExerciseStartedAndSubmissionAllowed(QuizMode quizMode) throws Exception { var quizEx = QuizExerciseFactory.generateQuizExercise(ZonedDateTime.now().minusMinutes(1), ZonedDateTime.now().plusMinutes(5), quizMode, course).duration(360); quizEx = exerciseRepo.save(quizEx); - quizUtilService.prepareBatchForSubmitting(quizEx, SecurityUtils.makeAuthorizationObject(TEST_PREFIX + "instructor1"), - SecurityContextHolder.getContext().getAuthentication()); + + if (quizMode != QuizMode.SYNCHRONIZED) { + var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizEx, ZonedDateTime.now().minusSeconds(10))); + quizExerciseUtilService.joinQuizBatch(quizEx, batch, TEST_PREFIX + "student1"); + } var participation = request.get("/api/exercises/" + quizEx.getId() + "/participation", HttpStatus.OK, StudentParticipation.class); assertThat(participation.getExercise()).as("Participation contains exercise").isEqualTo(quizEx); assertThat(participation.getResults()).as("New result was added to the participation").hasSize(1); From 650a66b9f5824ac14a5382d01f6d76fb7c5db20f Mon Sep 17 00:00:00 2001 From: lara Date: Wed, 13 Sep 2023 21:44:48 +0200 Subject: [PATCH 34/60] fix NotificationScheduleServiceTest --- .../NotificationScheduleServiceTest.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java index 0bfc5eb7b796..f528d49903d7 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java @@ -64,24 +64,27 @@ class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILo private User user; + private long sizeBefore; + @BeforeEach void init() { userUtilService.addUsers(TEST_PREFIX, 1, 1, 1, 1); user = userUtilService.getUserByLogin(TEST_PREFIX + "student1"); final Course course = courseUtilService.addCourseWithModelingAndTextExercise(); exercise = exerciseUtilService.getFirstExerciseWithType(course, TextExercise.class); - exercise.setReleaseDate(now().plus(500, ChronoUnit.MILLIS)); - exercise.setAssessmentDueDate(now().plus(2, ChronoUnit.SECONDS)); - exerciseRepository.save(exercise); + doNothing().when(javaMailSender).send(any(MimeMessage.class)); + sizeBefore = notificationRepository.count(); } @Test @Timeout(10) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void shouldCreateNotificationAndEmailAtReleaseDate() { - long sizeBefore = notificationRepository.count(); notificationSettingRepository.save(new NotificationSetting(user, true, true, true, NOTIFICATION__EXERCISE_NOTIFICATION__EXERCISE_RELEASED)); + exercise.setReleaseDate(now().plus(200, ChronoUnit.MILLIS)); + exerciseRepository.saveAndFlush(exercise); + instanceMessageReceiveService.processScheduleExerciseReleasedNotification(exercise.getId()); await().until(() -> notificationRepository.count() > sizeBefore); verify(groupNotificationService, timeout(4000)).notifyAllGroupsAboutReleasedExercise(exercise); @@ -92,7 +95,6 @@ void shouldCreateNotificationAndEmailAtReleaseDate() { @Timeout(10) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void shouldCreateNotificationAndEmailAtAssessmentDueDate() { - long sizeBefore = notificationRepository.count(); TextSubmission textSubmission = new TextSubmission(); textSubmission.text("Text"); textSubmission.submitted(true); @@ -104,7 +106,8 @@ void shouldCreateNotificationAndEmailAtAssessmentDueDate() { resultRepository.save(manualResult); notificationSettingRepository.save(new NotificationSetting(user, true, true, true, NOTIFICATION__EXERCISE_NOTIFICATION__EXERCISE_SUBMISSION_ASSESSED)); - + exercise.setAssessmentDueDate(now().plus(200, ChronoUnit.MILLIS)); + exerciseRepository.saveAndFlush(exercise); instanceMessageReceiveService.processScheduleAssessedExerciseSubmittedNotification(exercise.getId()); await().until(() -> notificationRepository.count() > sizeBefore); From 12064cec28ff0de433ffc2e1acdbd6369c1b404a Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 00:11:10 +0200 Subject: [PATCH 35/60] Fix flaky ProgrammingExerciseScheduleServiceTest --- ...rogrammingExerciseScheduleServiceTest.java | 309 ++++++++---------- 1 file changed, 140 insertions(+), 169 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java index 02f82420e635..3743439ed2ab 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java @@ -3,7 +3,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; -import java.net.URISyntaxException; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.List; @@ -88,6 +87,10 @@ class ProgrammingExerciseScheduleServiceTest extends AbstractSpringIntegrationGi // TODO: This could be improved by e.g. manually setting the system time instead of waiting for actual time to pass. private static final long SCHEDULER_TASK_TRIGGER_DELAY_MS = 1000; + private static final long DELAY_MS = 200; + + private static final long TIMEOUT_MS = 5000; + @BeforeEach void init() throws Exception { studentRepository.configureRepos("studentLocalRepo", "studentOriginRepo"); @@ -130,7 +133,7 @@ private void verifyLockStudentRepositoryAndParticipationOperation(boolean wasCal } } - private void mockStudentRepoLocks() throws URISyntaxException, GitAPIException, GitLabApiException { + private void mockStudentRepoLocks() throws GitAPIException, GitLabApiException { for (final var participation : programmingExercise.getStudentParticipations()) { final VcsRepositoryUrl repositoryUrl = ((ProgrammingExerciseParticipation) participation).getVcsRepositoryUrl(); gitlabRequestMockProvider.setRepositoryPermissionsToReadOnly(repositoryUrl, participation.getStudents()); @@ -143,84 +146,75 @@ private void mockStudentRepoLocks() throws URISyntaxException, GitAPIException, @WithMockUser(username = "admin", roles = "ADMIN") void shouldExecuteScheduledBuildAndTestAfterDueDate() throws Exception { mockStudentRepoLocks(); - final var dueDateDelayMS = 200; - programmingExercise.setDueDate(ZonedDateTime.now().plus(dueDateDelayMS / 2, ChronoUnit.MILLIS)); - programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(plusMillis(ZonedDateTime.now(), dueDateDelayMS)); - programmingExerciseRepository.save(programmingExercise); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); + programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(nowPlusMillis(DELAY_MS)); + programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // Lock student repository must be called once per participation. - verifyLockStudentRepositoryAndParticipationOperation(true, dueDateDelayMS); + verifyLockStudentRepositoryAndParticipationOperation(true, TIMEOUT_MS); // Instructor build should have been triggered. - verify(programmingTriggerService, timeout(dueDateDelayMS)).triggerInstructorBuildForExercise(programmingExercise.getId()); + verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } @Test @WithMockUser(username = "admin", roles = "ADMIN") - void shouldNotExecuteScheduledIfBuildAndTestAfterDueDateHasPassed() throws InterruptedException { + void shouldNotExecuteScheduledIfBuildAndTestAfterDueDateHasPassed() { programmingExercise.setDueDate(ZonedDateTime.now().minusHours(1L)); programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(ZonedDateTime.now().minusHours(1L)); - programmingExerciseRepository.save(programmingExercise); + programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - Thread.sleep(SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - // Lock student repository must not be called. - verifyLockStudentRepositoryAndParticipationOperation(false, 0); + verifyLockStudentRepositoryAndParticipationOperation(false, TIMEOUT_MS); verify(programmingTriggerService, never()).triggerInstructorBuildForExercise(programmingExercise.getId()); } @Test @WithMockUser(username = "admin", roles = "ADMIN") - void shouldNotExecuteScheduledIfBuildAndTestAfterDueDateIsNull() throws InterruptedException { + void shouldNotExecuteScheduledIfBuildAndTestAfterDueDateIsNull() { instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - Thread.sleep(SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - - // Lock student repository must not be called. - verifyLockStudentRepositoryAndParticipationOperation(false, 0); - verify(programmingTriggerService, never()).triggerInstructorBuildForExercise(programmingExercise.getId()); + verify(programmingTriggerService, after(SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).triggerInstructorBuildForExercise(programmingExercise.getId()); // Update all scores should not have been triggered. verify(programmingExerciseGradingService, never()).updateAllResults(programmingExercise); + // Lock student repository must not be called. + verifyLockStudentRepositoryAndParticipationOperation(false, 0); } @Test @WithMockUser(username = "admin", roles = "ADMIN") void shouldNotExecuteScheduledTwiceIfSameExercise() throws Exception { mockStudentRepoLocks(); - long delayMS = 200; // 200 ms. - programmingExercise.setDueDate(plusMillis(ZonedDateTime.now(), delayMS / 2)); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); // Setting it the first time. - programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(plusMillis(ZonedDateTime.now(), delayMS)); - programmingExercise = programmingExerciseRepository.save(programmingExercise); + programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(nowPlusMillis(DELAY_MS)); + programmingExercise = programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // Setting it the second time. - programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(plusMillis(ZonedDateTime.now(), delayMS * 2)); - programmingExercise = programmingExerciseRepository.save(programmingExercise); + programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(nowPlusMillis(DELAY_MS)); + programmingExercise = programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // Lock student repository must be called once per participation. - verifyLockStudentRepositoryAndParticipationOperation(true, delayMS * 2); - verify(programmingTriggerService, timeout(delayMS * 2)).triggerInstructorBuildForExercise(programmingExercise.getId()); + verifyLockStudentRepositoryAndParticipationOperation(true, TIMEOUT_MS); + verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } @Test @WithMockUser(username = "admin", roles = "ADMIN") - void shouldNotExecuteScheduledIfBuildAndTestAfterDueDateChangesToNull() throws InterruptedException { - long delayMS = 200; + void shouldNotExecuteScheduledIfBuildAndTestAfterDueDateChangesToNull() { // Setting it the first time. - programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(plusMillis(ZonedDateTime.now(), delayMS)); + programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(nowPlusMillis(DELAY_MS)); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // Now setting the date to null - this must also clear the old scheduled task! programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(null); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - Thread.sleep(delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - + verify(programmingTriggerService, after(SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).triggerInstructorBuildForExercise(programmingExercise.getId()); verifyLockStudentRepositoryAndParticipationOperation(false, 0); - verify(programmingTriggerService, never()).triggerInstructorBuildForExercise(programmingExercise.getId()); verify(programmingExerciseGradingService, never()).updateAllResults(programmingExercise); } @@ -228,55 +222,48 @@ void shouldNotExecuteScheduledIfBuildAndTestAfterDueDateChangesToNull() throws I @WithMockUser(username = "admin", roles = "ADMIN") void shouldScheduleExercisesWithBuildAndTestDateInFuture() throws Exception { mockStudentRepoLocks(); - long delayMS = 800; - programmingExercise.setDueDate(plusMillis(ZonedDateTime.now(), delayMS / 2)); - programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(plusMillis(ZonedDateTime.now(), delayMS)); - programmingExerciseRepository.save(programmingExercise); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); + programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(nowPlusMillis(DELAY_MS * 2)); + programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verifyLockStudentRepositoryAndParticipationOperation(true, delayMS); - verify(programmingTriggerService, timeout(5000)).triggerInstructorBuildForExercise(programmingExercise.getId()); + verifyLockStudentRepositoryAndParticipationOperation(true, TIMEOUT_MS); + verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } @Test - @WithMockUser(username = "admin", roles = "ADMIN") + @WithMockUser(username = "admin", roles = "ADMIN") // failed void shouldScheduleExercisesWithManualAssessment() throws Exception { mockStudentRepoLocks(); - long delayMS = 200; - programmingExercise.setDueDate(plusMillis(ZonedDateTime.now(), delayMS / 2)); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(null); programmingExercise.setAssessmentType(AssessmentType.SEMI_AUTOMATIC); - programmingExerciseRepository.save(programmingExercise); + programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - Thread.sleep(delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - - // Only lock participations - verifyLockStudentRepositoryAndParticipationOperation(true, delayMS); // but do not build all - verify(programmingTriggerService, never()).triggerInstructorBuildForExercise(programmingExercise.getId()); + verify(programmingTriggerService, after(SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).triggerInstructorBuildForExercise(programmingExercise.getId()); + // Only lock participations + verifyLockStudentRepositoryAndParticipationOperation(true, TIMEOUT_MS); } @Test @WithMockUser(username = "admin", roles = "ADMIN") void shouldUpdateScoresIfHasTestsAfterDueDateAndNoBuildAfterDueDate() throws Exception { mockStudentRepoLocks(); - final var dueDateDelayMS = 500; - programmingExercise.setDueDate(ZonedDateTime.now().plus(dueDateDelayMS / 2, ChronoUnit.MILLIS)); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(null); - programmingExerciseRepository.save(programmingExercise); + programmingExerciseRepository.saveAndFlush(programmingExercise); var testCases = programmingExerciseTestCaseRepository.findByExerciseId(programmingExercise.getId()); testCases.stream().findFirst().orElseThrow().setVisibility(Visibility.AFTER_DUE_DATE); - programmingExerciseTestCaseRepository.saveAll(testCases); + programmingExerciseTestCaseRepository.saveAllAndFlush(testCases); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - Thread.sleep(dueDateDelayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - - verifyLockStudentRepositoryAndParticipationOperation(true, dueDateDelayMS); - verify(programmingTriggerService, never()).triggerInstructorBuildForExercise(programmingExercise.getId()); + verify(programmingTriggerService, after(SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).triggerInstructorBuildForExercise(programmingExercise.getId()); + verifyLockStudentRepositoryAndParticipationOperation(true, TIMEOUT_MS); // has AFTER_DUE_DATE tests and no additional build after due date => update the scores to show those test cases in it verify(programmingExerciseGradingService, timeout(5000)).updateResultsOnlyRegularDueDateParticipations(programmingExercise); // make sure to trigger the update only for participants who do not have got an individual due date @@ -287,55 +274,49 @@ void shouldUpdateScoresIfHasTestsAfterDueDateAndNoBuildAfterDueDate() throws Exc @WithMockUser(username = "admin", roles = "ADMIN") void shouldNotUpdateScoresIfHasTestsAfterDueDateAndBuildAfterDueDate() throws Exception { mockStudentRepoLocks(); - final var dueDateDelayMS = 500; - programmingExercise.setDueDate(ZonedDateTime.now().plus(dueDateDelayMS / 2, ChronoUnit.MILLIS)); - programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(plusMillis(ZonedDateTime.now(), dueDateDelayMS)); - programmingExerciseRepository.save(programmingExercise); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); + programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(nowPlusMillis(DELAY_MS * 2)); + programmingExerciseRepository.saveAndFlush(programmingExercise); var testCases = programmingExerciseTestCaseRepository.findByExerciseId(programmingExercise.getId()); testCases.stream().findFirst().orElseThrow().setVisibility(Visibility.AFTER_DUE_DATE); - programmingExerciseTestCaseRepository.saveAll(testCases); + programmingExerciseTestCaseRepository.saveAllAndFlush(testCases); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - Thread.sleep(dueDateDelayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - - verifyLockStudentRepositoryAndParticipationOperation(true, dueDateDelayMS / 2); - verify(programmingTriggerService, timeout(dueDateDelayMS)).triggerInstructorBuildForExercise(programmingExercise.getId()); // has AFTER_DUE_DATE tests, but also buildAfterDueDate => do not update results, but use the results created on additional build run - verify(programmingExerciseGradingService, never()).updateAllResults(programmingExercise); + verify(programmingExerciseGradingService, after(SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).updateAllResults(programmingExercise); + verifyLockStudentRepositoryAndParticipationOperation(true, TIMEOUT_MS); + verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } - @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") // failed @ValueSource(booleans = { true, false }) @WithMockUser(username = "admin", roles = "ADMIN") void shouldNotUpdateScoresIfHasNoTestsAfterDueDate(boolean hasBuildAndTestAfterDueDate) throws Exception { mockStudentRepoLocks(); - final var dueDateDelayMS = 200; - programmingExercise.setDueDate(ZonedDateTime.now().plus(dueDateDelayMS / 2, ChronoUnit.MILLIS)); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); if (hasBuildAndTestAfterDueDate) { - programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(plusMillis(ZonedDateTime.now(), dueDateDelayMS)); + programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(nowPlusMillis(DELAY_MS * 2)); } else { programmingExercise.setBuildAndTestStudentSubmissionsAfterDueDate(null); } - programmingExerciseRepository.save(programmingExercise); + programmingExerciseRepository.saveAndFlush(programmingExercise); var testCases = programmingExerciseTestCaseRepository.findByExerciseId(programmingExercise.getId()); testCases.forEach(testCase -> testCase.setVisibility(Visibility.ALWAYS)); - programmingExerciseTestCaseRepository.saveAll(testCases); + programmingExerciseTestCaseRepository.saveAllAndFlush(testCases); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - Thread.sleep(dueDateDelayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - - verifyLockStudentRepositoryAndParticipationOperation(true, dueDateDelayMS / 2); + // no tests marked as AFTER_DUE_DATE => do not update scores on due date + verify(programmingExerciseGradingService, after(SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).updateAllResults(programmingExercise); + verifyLockStudentRepositoryAndParticipationOperation(true, TIMEOUT_MS); if (hasBuildAndTestAfterDueDate) { - verify(programmingTriggerService, timeout(dueDateDelayMS)).triggerInstructorBuildForExercise(programmingExercise.getId()); + verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } else { verify(programmingTriggerService, never()).triggerInstructorBuildForExercise(programmingExercise.getId()); } - // no tests marked as AFTER_DUE_DATE => do not update scores on due date - verify(programmingExerciseGradingService, never()).updateAllResults(programmingExercise); } @Test @@ -345,23 +326,22 @@ void testCombineTemplateBeforeRelease() throws Exception { VcsRepositoryUrl repositoryUrl = programmingExerciseWithTemplate.getVcsTemplateRepositoryUrl(); doNothing().when(gitService).combineAllCommitsOfRepositoryIntoOne(repositoryUrl); - programmingExercise.setReleaseDate(ZonedDateTime.now().plusSeconds(Constants.SECONDS_BEFORE_RELEASE_DATE_FOR_COMBINING_TEMPLATE_COMMITS + 1)); - programmingExerciseRepository.save(programmingExercise); + programmingExercise.setReleaseDate(nowPlusMillis(DELAY_MS).plusSeconds(Constants.SECONDS_BEFORE_RELEASE_DATE_FOR_COMBINING_TEMPLATE_COMMITS)); + programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(gitService, timeout(5000)).combineAllCommitsOfRepositoryIntoOne(repositoryUrl); + verify(gitService, timeout(TIMEOUT_MS)).combineAllCommitsOfRepositoryIntoOne(repositoryUrl); } @Test @WithMockUser(username = "admin", roles = "ADMIN") void scheduleIndividualDueDateNoBuildAndTestDateLock() throws Exception { mockStudentRepoLocks(); - final long delayMS = 400; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, delayMS / 2, null); + setupProgrammingExerciseDates(now, DELAY_MS, null); var login = TEST_PREFIX + "student3"; - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 3 * delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS, login); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, login); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); @@ -374,220 +354,209 @@ void scheduleIndividualDueDateNoBuildAndTestDateLock() throws Exception { assertThat(studentParticipationIndividualDueDate.getIndividualDueDate()).isNotEqualTo(programmingExercise.getDueDate()); // the repo-lock for the participation with a later due date should only have been called after that individual due date has passed - verifyLockStudentRepositoryAndParticipationOperation(true, studentParticipationsRegularDueDate, delayMS); + verifyLockStudentRepositoryAndParticipationOperation(true, studentParticipationsRegularDueDate, TIMEOUT_MS); // first the operation should not be called verifyLockStudentRepositoryAndParticipationOperation(false, participationIndividualDueDate, 0); // after some time the operation should be called as well (verify waits up to 5s until this condition is fulfilled) - verifyLockStudentRepositoryAndParticipationOperation(true, participationIndividualDueDate, 3 * delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); + verifyLockStudentRepositoryAndParticipationOperation(true, participationIndividualDueDate, TIMEOUT_MS); } @Test - @WithMockUser(username = "admin", roles = "ADMIN") + @WithMockUser(username = "admin", roles = "ADMIN") // failed void scheduleIndividualDueDateBetweenDueDateAndBuildAndTestDate() throws Exception { mockStudentRepoLocks(); - final long delayMS = 200; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, delayMS / 2, 2 * SCHEDULER_TASK_TRIGGER_DELAY_MS); + setupProgrammingExerciseDates(now, DELAY_MS, DELAY_MS * 3); // individual due date between regular due date and build and test date - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); verify(scheduleService, never()).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); - Thread.sleep(delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok - // not yet locked on regular due date + verify(programmingTriggerService, after(DELAY_MS).never()).triggerInstructorBuildForExercise(programmingExercise.getId()); verifyLockStudentRepositoryAndParticipationOperation(false, participationIndividualDueDate, 0); - verify(programmingTriggerService, never()).triggerInstructorBuildForExercise(programmingExercise.getId()); // locked after individual due date - verifyLockStudentRepositoryAndParticipationOperation(true, participationIndividualDueDate, 2 * delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); - - Thread.sleep(delayMS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // ok + verifyLockStudentRepositoryAndParticipationOperation(true, participationIndividualDueDate, 2 * DELAY_MS); // after build and test date: no individual build and test actions are scheduled - verify(programmingTriggerService, never()).triggerBuildForParticipations(List.of(participationIndividualDueDate)); - verify(programmingTriggerService, timeout(2 * SCHEDULER_TASK_TRIGGER_DELAY_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); + verify(programmingTriggerService, after(DELAY_MS * 3).never()).triggerBuildForParticipations(List.of(participationIndividualDueDate)); + verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } @Test @WithMockUser(username = "admin", roles = "ADMIN") void scheduleIndividualDueDateAfterBuildAndTestDate() throws Exception { mockStudentRepoLocks(); - final long delayMS = 200; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, delayMS / 2, delayMS); + setupProgrammingExerciseDates(now, DELAY_MS, DELAY_MS); // individual due date after build and test date - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // special scheduling for both lock and build and test - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); } @Test @WithMockUser(username = "admin", roles = "ADMIN") void scheduleIndividualDueDateTestsAfterDueDateNoBuildAndTestDate() throws Exception { mockStudentRepoLocks(); - final long delayMS = 500; final ZonedDateTime now = ZonedDateTime.now(); // no build and test date, but after_due_date tests ⇒ score update needed - setupProgrammingExerciseDates(now, delayMS / 2, null); + setupProgrammingExerciseDates(now, DELAY_MS, null); var testCases = programmingExerciseTestCaseRepository.findByExerciseId(programmingExercise.getId()); testCases.stream().findFirst().orElseThrow().setVisibility(Visibility.AFTER_DUE_DATE); - programmingExerciseTestCaseRepository.saveAll(testCases); + programmingExerciseTestCaseRepository.saveAllAndFlush(testCases); - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); verify(scheduleService, never()).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); - verify(scheduleService, timeout(5000)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); verify(scheduleService, never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any(Runnable.class)); } - @Test + @Test // failed @WithMockUser(username = "admin", roles = "ADMIN") void cancelAllSchedulesOnRemovingExerciseDueDate() throws Exception { mockStudentRepoLocks(); - final long delayMS = 500; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, delayMS / 2, null); + setupProgrammingExerciseDates(now, DELAY_MS, null); var testCases = programmingExerciseTestCaseRepository.findByExerciseId(programmingExercise.getId()); testCases.stream().findFirst().orElseThrow().setVisibility(Visibility.AFTER_DUE_DATE); programmingExerciseTestCaseRepository.saveAll(testCases); - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); verify(scheduleService, never()).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); - verify(scheduleService, timeout(5000)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); verify(scheduleService, never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any(Runnable.class)); // remove due date and schedule again programmingExercise.setDueDate(null); - programmingExercise = programmingExerciseRepository.save(programmingExercise); + programmingExercise = programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // all schedules are cancelled InOrder cancelCalls = inOrder(scheduleService); - cancelCalls.verify(scheduleService, timeout(5000)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.DUE); - cancelCalls.verify(scheduleService, timeout(5000)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE); + cancelCalls.verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.DUE); + cancelCalls.verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE); for (final var participation : programmingExercise.getStudentParticipations()) { - cancelCalls.verify(scheduleService, timeout(5000)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participation.getId(), + cancelCalls.verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participation.getId(), ParticipationLifecycle.DUE); - cancelCalls.verify(scheduleService, timeout(5000)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participation.getId(), + cancelCalls.verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participation.getId(), ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE); } } - @Test - @WithMockUser(username = "admin", roles = "ADMIN") + @Test // failed + @WithMockUser(username = "admin", roles = "ADMIN") // failed void cancelIndividualSchedulesOnRemovingIndividualDueDate() throws Exception { mockStudentRepoLocks(); - final long delayMS = 200; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, delayMS, null); + setupProgrammingExerciseDates(now, DELAY_MS, null); - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * DELAY_MS, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); - verify(scheduleService, timeout(5000)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); // remove individual due date and schedule again participationIndividualDueDate.setIndividualDueDate(null); - participationIndividualDueDate = participationRepository.save(participationIndividualDueDate); + participationIndividualDueDate = participationRepository.saveAndFlush(participationIndividualDueDate); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // called twice: first time when removing potential old schedules before scheduling, second time only cancelling - verify(scheduleService, timeout(5000).times(2)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participationIndividualDueDate.getId(), + verify(scheduleService, timeout(TIMEOUT_MS).times(2)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participationIndividualDueDate.getId(), ParticipationLifecycle.DUE); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); } @Test @WithMockUser(username = "admin", roles = "ADMIN") void updateIndividualScheduleOnIndividualDueDateChange() throws Exception { mockStudentRepoLocks(); - final long delayMS = 500; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, delayMS / 2, null); + setupProgrammingExerciseDates(now, DELAY_MS, null); - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * DELAY_MS, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); - verify(scheduleService, timeout(5000)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); // change individual due date and schedule again - participationIndividualDueDate.setIndividualDueDate(plusMillis(now, 3 * delayMS)); - participationIndividualDueDate = participationRepository.save(participationIndividualDueDate); + participationIndividualDueDate.setIndividualDueDate(nowPlusMillis(DELAY_MS)); + participationIndividualDueDate = participationRepository.saveAndFlush(participationIndividualDueDate); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); // scheduling called twice, each scheduling cancels potential old schedules - verify(scheduleService, timeout(5000).times(2)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participationIndividualDueDate.getId(), + verify(scheduleService, timeout(TIMEOUT_MS).times(2)).cancelScheduledTaskForParticipationLifecycle(programmingExercise.getId(), participationIndividualDueDate.getId(), ParticipationLifecycle.DUE); - verify(scheduleService, timeout(5000).times(2)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS).times(2)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); } - @Test + @Test // failed @WithMockUser(username = "admin", roles = "ADMIN") void keepIndividualScheduleOnExerciseDueDateChange() throws Exception { mockStudentRepoLocks(); - final long delayMS = 500; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, delayMS / 2, null); + setupProgrammingExerciseDates(now, DELAY_MS, null); var testCases = programmingExerciseTestCaseRepository.findByExerciseId(programmingExercise.getId()); testCases.stream().findFirst().orElseThrow().setVisibility(Visibility.AFTER_DUE_DATE); - programmingExerciseTestCaseRepository.saveAll(testCases); + programmingExerciseTestCaseRepository.saveAllAndFlush(testCases); - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); verify(scheduleService, never()).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); - verify(scheduleService, timeout(5000)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); verify(scheduleService, never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any(Runnable.class)); // change exercise due date and schedule again - programmingExercise.setDueDate(plusMillis(now, delayMS)); - programmingExercise = programmingExerciseRepository.save(programmingExercise); + programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); + programmingExercise = programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000).times(2)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS).times(2)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); verify(scheduleService, never()).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); - verify(scheduleService, timeout(5000).times(2)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); + verify(scheduleService, timeout(TIMEOUT_MS).times(2)).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); verify(scheduleService, never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any(Runnable.class)); } @@ -595,19 +564,18 @@ void keepIndividualScheduleOnExerciseDueDateChange() throws Exception { @WithMockUser(username = "admin", roles = "ADMIN") void shouldScheduleExerciseIfAnyIndividualDueDateInFuture() throws Exception { mockStudentRepoLocks(); - final long delayMS = 200; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, -1 * delayMS / 2, null); + setupProgrammingExerciseDates(now, -DELAY_MS, null); programmingExercise.setReleaseDate(ZonedDateTime.now().minusHours(1)); - programmingExercise = programmingExerciseRepository.save(programmingExercise); + programmingExercise = programmingExerciseRepository.saveAndFlush(programmingExercise); - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, 2 * delayMS, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(5000)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); verify(scheduleService, never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); } @@ -615,22 +583,21 @@ void shouldScheduleExerciseIfAnyIndividualDueDateInFuture() throws Exception { @WithMockUser(username = "admin", roles = "ADMIN") void shouldCancelAllTasksIfSchedulingNoLongerNeeded() throws Exception { mockStudentRepoLocks(); - final long delayMS = 200; final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, -1 * delayMS / 2, null); + setupProgrammingExerciseDates(now, -DELAY_MS, null); programmingExercise.setReleaseDate(ZonedDateTime.now().minusHours(1)); programmingExercise.setAssessmentType(AssessmentType.AUTOMATIC); programmingExercise.setAllowComplaintsForAutomaticAssessments(false); - programmingExercise = programmingExerciseRepository.save(programmingExercise); + programmingExercise = programmingExerciseRepository.saveAndFlush(programmingExercise); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); - verify(scheduleService, timeout(5000)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.RELEASE); - verify(scheduleService, timeout(5000)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.DUE); - verify(scheduleService, timeout(5000)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE); - verify(scheduleService, timeout(5000)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.ASSESSMENT_DUE); + verify(scheduleService, after(SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.DUE), any(Runnable.class)); + verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.RELEASE); + verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.DUE); + verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE); + verify(scheduleService, timeout(TIMEOUT_MS)).cancelScheduledTaskForLifecycle(programmingExercise.getId(), ExerciseLifecycle.ASSESSMENT_DUE); } @Test @@ -639,18 +606,18 @@ void testExamWorkingTimeChangeDuringConduction() { ProgrammingExercise examExercise = programmingExerciseUtilService.addCourseExamExerciseGroupWithOneProgrammingExercise(); Exam exam = examExercise.getExamViaExerciseGroupOrCourseMember(); exam.setStartDate(ZonedDateTime.now().minusMinutes(1)); - exam = examRepository.save(exam); + exam = examRepository.saveAndFlush(exam); User user = userUtilService.getUserByLogin(TEST_PREFIX + "student1"); StudentExam studentExam = examUtilService.addStudentExamWithUser(exam, user); ProgrammingExerciseStudentParticipation participation = (ProgrammingExerciseStudentParticipation) participationUtilService .addProgrammingParticipationWithResultForExercise(examExercise, TEST_PREFIX + "student1").getParticipation(); studentExam.setExercises(List.of(examExercise)); studentExam.setWorkingTime(1); - studentExamRepository.save(studentExam); + studentExamRepository.saveAndFlush(studentExam); instanceMessageReceiveService.processExamWorkingTimeChangeDuringConduction(studentExam.getId()); - verify(versionControlService, timeout(200)).setRepositoryPermissionsToReadOnly(participation.getVcsRepositoryUrl(), examExercise.getProjectKey(), + verify(versionControlService, timeout(TIMEOUT_MS)).setRepositoryPermissionsToReadOnly(participation.getVcsRepositoryUrl(), examExercise.getProjectKey(), participation.getStudents()); } @@ -676,7 +643,7 @@ private void setupProgrammingExerciseDates(final ZonedDateTime reference, Long d } programmingExercise.setAssessmentType(AssessmentType.SEMI_AUTOMATIC); - programmingExercise = programmingExerciseRepository.save(programmingExercise); + programmingExercise = programmingExerciseRepository.saveAndFlush(programmingExercise); } private ProgrammingExerciseStudentParticipation setupParticipationIndividualDueDate(final ZonedDateTime reference, Long individualDueDateDelayMillis, String login) { @@ -689,7 +656,7 @@ private ProgrammingExerciseStudentParticipation setupParticipationIndividualDueD participationIndividualDueDate.setIndividualDueDate(null); } - return participationRepository.save((ProgrammingExerciseStudentParticipation) participationIndividualDueDate); + return participationRepository.saveAndFlush((ProgrammingExerciseStudentParticipation) participationIndividualDueDate); } private StudentParticipation getParticipation(String login) { @@ -704,4 +671,8 @@ private List getParticipationsWithoutIndividualDueDate() { private ZonedDateTime plusMillis(final ZonedDateTime reference, long millis) { return reference.plus(millis, ChronoUnit.MILLIS); } + + private ZonedDateTime nowPlusMillis(long millis) { + return ZonedDateTime.now().plus(millis, ChronoUnit.MILLIS); + } } From 41348c076b26a7d2bab27f7d3b7c347c0f562704 Mon Sep 17 00:00:00 2001 From: lara Date: Thu, 14 Sep 2023 00:12:35 +0200 Subject: [PATCH 36/60] fix lockAllRepositories --- .../ProgrammingExerciseIntegrationTestService.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseIntegrationTestService.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseIntegrationTestService.java index 564dbd60afb2..f0b9ef97c88f 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseIntegrationTestService.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseIntegrationTestService.java @@ -1630,12 +1630,13 @@ void lockAllRepositories() throws Exception { verify(versionControlService, timeout(300)).setRepositoryPermissionsToReadOnly(participation2.getVcsRepositoryUrl(), programmingExercise.getProjectKey(), participation2.getStudents()); - userUtilService.changeUser(userPrefix + "instructor1"); - - var notifications = request.getList("/api/notifications", HttpStatus.OK, Notification.class); - assertThat(notifications).as("Instructor get notified that lock operations were successful") - .anyMatch(n -> n.getText().contains(Constants.PROGRAMMING_EXERCISE_SUCCESSFUL_LOCK_OPERATION_NOTIFICATION)) - .noneMatch(n -> n.getText().contains(Constants.PROGRAMMING_EXERCISE_FAILED_LOCK_OPERATIONS_NOTIFICATION)); + await().untilAsserted(() -> { + userUtilService.changeUser(userPrefix + "instructor1"); + var notifications = request.getList("/api/notifications", HttpStatus.OK, Notification.class); + assertThat(notifications).as("Instructor get notified that lock operations were successful") + .anyMatch(n -> n.getText().contains(Constants.PROGRAMMING_EXERCISE_SUCCESSFUL_LOCK_OPERATION_NOTIFICATION)) + .noneMatch(n -> n.getText().contains(Constants.PROGRAMMING_EXERCISE_FAILED_LOCK_OPERATIONS_NOTIFICATION)); + }); } void unlockAllRepositories_asStudent_forbidden() throws Exception { From 3ccafe157f8d7552a01ccf79ba0800b38c7a6eca Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:44:17 +0200 Subject: [PATCH 37/60] Remove new comments from ProgrammingExerciseScheduleServiceTest --- .../ProgrammingExerciseScheduleServiceTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java index 3743439ed2ab..34a800a1ac89 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java @@ -233,7 +233,7 @@ void shouldScheduleExercisesWithBuildAndTestDateInFuture() throws Exception { } @Test - @WithMockUser(username = "admin", roles = "ADMIN") // failed + @WithMockUser(username = "admin", roles = "ADMIN") void shouldScheduleExercisesWithManualAssessment() throws Exception { mockStudentRepoLocks(); programmingExercise.setDueDate(nowPlusMillis(DELAY_MS)); @@ -289,7 +289,7 @@ void shouldNotUpdateScoresIfHasTestsAfterDueDateAndBuildAfterDueDate() throws Ex verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } - @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") // failed + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") @ValueSource(booleans = { true, false }) @WithMockUser(username = "admin", roles = "ADMIN") void shouldNotUpdateScoresIfHasNoTestsAfterDueDate(boolean hasBuildAndTestAfterDueDate) throws Exception { @@ -362,7 +362,7 @@ void scheduleIndividualDueDateNoBuildAndTestDateLock() throws Exception { } @Test - @WithMockUser(username = "admin", roles = "ADMIN") // failed + @WithMockUser(username = "admin", roles = "ADMIN") void scheduleIndividualDueDateBetweenDueDateAndBuildAndTestDate() throws Exception { mockStudentRepoLocks(); final ZonedDateTime now = ZonedDateTime.now(); @@ -431,7 +431,7 @@ void scheduleIndividualDueDateTestsAfterDueDateNoBuildAndTestDate() throws Excep verify(scheduleService, never()).scheduleTask(eq(programmingExercise), eq(ExerciseLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any(Runnable.class)); } - @Test // failed + @Test @WithMockUser(username = "admin", roles = "ADMIN") void cancelAllSchedulesOnRemovingExerciseDueDate() throws Exception { mockStudentRepoLocks(); @@ -471,8 +471,8 @@ void cancelAllSchedulesOnRemovingExerciseDueDate() throws Exception { } } - @Test // failed - @WithMockUser(username = "admin", roles = "ADMIN") // failed + @Test + @WithMockUser(username = "admin", roles = "ADMIN") void cancelIndividualSchedulesOnRemovingIndividualDueDate() throws Exception { mockStudentRepoLocks(); final ZonedDateTime now = ZonedDateTime.now(); @@ -526,7 +526,7 @@ void updateIndividualScheduleOnIndividualDueDateChange() throws Exception { verify(scheduleService, timeout(TIMEOUT_MS).times(2)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); } - @Test // failed + @Test @WithMockUser(username = "admin", roles = "ADMIN") void keepIndividualScheduleOnExerciseDueDateChange() throws Exception { mockStudentRepoLocks(); From 4d180b85dabcbad2c8260b680a6b9950bf2154c6 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:40:48 +0200 Subject: [PATCH 38/60] Add constants for delay and timeout --- .../NotificationScheduleServiceTest.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java index f528d49903d7..512ba0c6fea7 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; @@ -66,6 +65,11 @@ class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILo private long sizeBefore; + // TODO: This could be improved by e.g. manually setting the system time instead of waiting for actual time to pass. + private static final long DELAY_MS = 200; + + private static final long TIMEOUT_MS = 5000; + @BeforeEach void init() { userUtilService.addUsers(TEST_PREFIX, 1, 1, 1, 1); @@ -78,21 +82,19 @@ void init() { } @Test - @Timeout(10) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void shouldCreateNotificationAndEmailAtReleaseDate() { - notificationSettingRepository.save(new NotificationSetting(user, true, true, true, NOTIFICATION__EXERCISE_NOTIFICATION__EXERCISE_RELEASED)); - exercise.setReleaseDate(now().plus(200, ChronoUnit.MILLIS)); + notificationSettingRepository.saveAndFlush(new NotificationSetting(user, true, true, true, NOTIFICATION__EXERCISE_NOTIFICATION__EXERCISE_RELEASED)); + exercise.setReleaseDate(now().plus(DELAY_MS, ChronoUnit.MILLIS)); exerciseRepository.saveAndFlush(exercise); instanceMessageReceiveService.processScheduleExerciseReleasedNotification(exercise.getId()); await().until(() -> notificationRepository.count() > sizeBefore); - verify(groupNotificationService, timeout(4000)).notifyAllGroupsAboutReleasedExercise(exercise); - verify(mailService, timeout(4000).atLeastOnce()).sendNotification(any(), anySet(), any()); + verify(groupNotificationService, timeout(TIMEOUT_MS)).notifyAllGroupsAboutReleasedExercise(exercise); + verify(mailService, timeout(TIMEOUT_MS).atLeastOnce()).sendNotification(any(), anySet(), any()); } @Test - @Timeout(10) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void shouldCreateNotificationAndEmailAtAssessmentDueDate() { TextSubmission textSubmission = new TextSubmission(); @@ -103,15 +105,15 @@ void shouldCreateNotificationAndEmailAtAssessmentDueDate() { Result manualResult = participationUtilService.createParticipationSubmissionAndResult(exercise.getId(), userUtilService.getUserByLogin(TEST_PREFIX + "student1"), 10.0, 10.0, 50, true); manualResult.setAssessmentType(AssessmentType.MANUAL); - resultRepository.save(manualResult); + resultRepository.saveAndFlush(manualResult); - notificationSettingRepository.save(new NotificationSetting(user, true, true, true, NOTIFICATION__EXERCISE_NOTIFICATION__EXERCISE_SUBMISSION_ASSESSED)); - exercise.setAssessmentDueDate(now().plus(200, ChronoUnit.MILLIS)); + notificationSettingRepository.saveAndFlush(new NotificationSetting(user, true, true, true, NOTIFICATION__EXERCISE_NOTIFICATION__EXERCISE_SUBMISSION_ASSESSED)); + exercise.setAssessmentDueDate(now().plus(DELAY_MS, ChronoUnit.MILLIS)); exerciseRepository.saveAndFlush(exercise); instanceMessageReceiveService.processScheduleAssessedExerciseSubmittedNotification(exercise.getId()); await().until(() -> notificationRepository.count() > sizeBefore); - verify(singleUserNotificationService, timeout(4000)).notifyUsersAboutAssessedExerciseSubmission(exercise); - verify(javaMailSender, timeout(4000)).send(any(MimeMessage.class)); + verify(singleUserNotificationService, timeout(TIMEOUT_MS)).notifyUsersAboutAssessedExerciseSubmission(exercise); + verify(javaMailSender, timeout(TIMEOUT_MS)).send(any(MimeMessage.class)); } } From f5e5835cfd4691b49b439fe6e423696609dc06ca Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:04:06 +0200 Subject: [PATCH 39/60] Isolated QuizCacheTest --- .../artemis/service/scheduled/cache/quiz/QuizCacheTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index ae58f09e5ab6..c6ef7f31c7c8 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -8,6 +8,8 @@ import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.parallel.Isolated; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +32,8 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.user.UserUtilService; +@Isolated +@Order(Integer.MAX_VALUE) class QuizCacheTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "quizcachetest"; From 01f9931cb064a8558e39dc92f1cc0a66229ef426 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 17:31:16 +0200 Subject: [PATCH 40/60] Increase delay in NotificationScheduleServiceTest --- .../artemis/notification/NotificationScheduleServiceTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java index 512ba0c6fea7..5a443eb362d6 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java @@ -66,7 +66,7 @@ class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILo private long sizeBefore; // TODO: This could be improved by e.g. manually setting the system time instead of waiting for actual time to pass. - private static final long DELAY_MS = 200; + private static final long DELAY_MS = 400; private static final long TIMEOUT_MS = 5000; From 9e3eabd759fd25bbef194c8689974ead255feb16 Mon Sep 17 00:00:00 2001 From: lara Date: Thu, 14 Sep 2023 19:37:14 +0200 Subject: [PATCH 41/60] fix DatabaseQueryCountTest --- .../tum/in/www1/artemis/DatabaseQueryCountTest.java | 5 +++++ .../ProgrammingSubmissionIntegrationTest.java | 12 ++---------- .../behavioral/BehavioralTestCaseServiceTest.java | 2 -- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java index 639a7975620f..403e9e1a1114 100644 --- a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java +++ b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java @@ -1,5 +1,7 @@ package de.tum.in.www1.artemis; +import java.util.Set; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.slf4j.Logger; @@ -10,6 +12,7 @@ import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; +import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.exam.StudentExam; import de.tum.in.www1.artemis.exam.ExamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; @@ -35,6 +38,8 @@ class DatabaseQueryCountTest extends AbstractSpringIntegrationTest { void setup() { participantScoreScheduleService.shutdown(); userUtilService.addUsers(TEST_PREFIX, 1, NUMBER_OF_TUTORS, 0, 0); + User student = userUtilService.getUserByLogin(TEST_PREFIX + "student1"); + student.setGroups(Set.of(TEST_PREFIX + "tumuser")); } @Test diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java index 1b4c28d7cefa..f4aad7eb54c9 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingSubmissionIntegrationTest.java @@ -16,7 +16,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; @@ -34,19 +33,13 @@ import de.tum.in.www1.artemis.domain.enumeration.SubmissionType; import de.tum.in.www1.artemis.domain.modeling.ModelingExercise; import de.tum.in.www1.artemis.domain.modeling.ModelingSubmission; -import de.tum.in.www1.artemis.domain.participation.Participation; -import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseParticipation; -import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; -import de.tum.in.www1.artemis.domain.participation.StudentParticipation; +import de.tum.in.www1.artemis.domain.participation.*; import de.tum.in.www1.artemis.exception.ContinuousIntegrationException; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.exercise.modelingexercise.ModelingExerciseUtilService; import de.tum.in.www1.artemis.participation.ParticipationFactory; import de.tum.in.www1.artemis.participation.ParticipationUtilService; -import de.tum.in.www1.artemis.repository.ProgrammingExerciseRepository; -import de.tum.in.www1.artemis.repository.ProgrammingExerciseStudentParticipationRepository; -import de.tum.in.www1.artemis.repository.ProgrammingSubmissionRepository; -import de.tum.in.www1.artemis.repository.StudentParticipationRepository; +import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.service.connectors.bamboo.dto.BambooBuildPlanDTO; import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; @@ -230,7 +223,6 @@ void triggerBuildStudentForbidden() throws Exception { } @Test - @Timeout(5) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void triggerBuildForExerciseAsInstructor() throws Exception { bambooRequestMockProvider.enableMockingOfRequests(); diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java index e0f94c1d7eb7..fcd475bebb72 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/behavioral/BehavioralTestCaseServiceTest.java @@ -6,7 +6,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; @@ -144,7 +143,6 @@ private TestwiseCoverageReportEntry newCoverageReportEntry(int startLine, int li } @Test - @Timeout(1000) @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void testGenerationForSimpleExample() throws Exception { exercise = hestiaUtilTestService.setupSolution("Test.java", "A\nB\nC\nD\nE\nF\nG\nH", exercise, solutionRepo); From 2cc4f998ff406b948a647c161656064df8f7f3ab Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 21:10:56 +0200 Subject: [PATCH 42/60] Increase delay in NotificationScheduleServiceTest Please work -.- --- .../artemis/notification/NotificationScheduleServiceTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java index 5a443eb362d6..db3749f2f846 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java @@ -66,7 +66,7 @@ class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILo private long sizeBefore; // TODO: This could be improved by e.g. manually setting the system time instead of waiting for actual time to pass. - private static final long DELAY_MS = 400; + private static final long DELAY_MS = 1000; private static final long TIMEOUT_MS = 5000; From 048034f85e9d50f98ec1defcc6b2a4c88215faad Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 14 Sep 2023 22:56:29 +0200 Subject: [PATCH 43/60] Change Order for Test Class Execution Order got reshuffled by #7160 after we have already fixed many flaky tests. A fixed order might mitigate this issue. Co-Authored-By: Lara Dvorsek <73339358+laadvo@users.noreply.github.com> --- .../AbstractSpringIntegrationBambooBitbucketJiraTest.java | 2 -- .../AbstractSpringIntegrationGitlabCIGitlabSamlTest.java | 2 -- .../artemis/AbstractSpringIntegrationJenkinsGitlabTest.java | 2 -- .../artemis/AbstractSpringIntegrationLocalCILocalVCTest.java | 2 -- .../de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java | 2 -- .../artemis/service/scheduled/cache/quiz/QuizCacheTest.java | 2 -- src/test/resources/junit-platform.properties | 4 ++-- 7 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java index effda8e0dfe3..6607569ad6e4 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationBambooBitbucketJiraTest.java @@ -16,7 +16,6 @@ import java.util.Set; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; @@ -60,7 +59,6 @@ import de.tum.in.www1.artemis.web.rest.vm.ManagedUserVM; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; -@Order(1) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java index 78a5dd719ae9..fb9b4f0af34d 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationGitlabCIGitlabSamlTest.java @@ -11,7 +11,6 @@ import org.gitlab4j.api.GitLabApiException; import org.gitlab4j.api.models.PipelineStatus; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; @@ -44,7 +43,6 @@ import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; -@Order(5) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java index e844d43e2089..0361716068b1 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationJenkinsGitlabTest.java @@ -13,7 +13,6 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; @@ -42,7 +41,6 @@ import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; import io.zonky.test.db.AutoConfigureEmbeddedDatabase; -@Order(2) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java index 62c8c48ffca9..2d4be7b9e015 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationLocalCILocalVCTest.java @@ -11,7 +11,6 @@ import org.gitlab4j.api.GitLabApiException; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; @@ -57,7 +56,6 @@ // Must start up an actual web server such that the tests can communicate with the ArtemisGitServlet using JGit. // Otherwise, only MockMvc requests could be used. The port this runs on is defined at server.port (see @TestPropertySource). // Note: Cannot use WebEnvironment.RANDOM_PORT here because artemis.version-control.url must be set to the correct port in the @TestPropertySource annotation. -@Order(4) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java index 05d9bebabbf4..f722ca7354e8 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java @@ -6,7 +6,6 @@ import java.util.Set; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.api.parallel.ExecutionMode; @@ -30,7 +29,6 @@ /** * This SpringBootTest is used for tests that only require a minimal set of Active Spring Profiles. */ -@Order(3) @SpringBootTest @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index c6ef7f31c7c8..0873ae6535c1 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -8,7 +8,6 @@ import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Order; import org.junit.jupiter.api.parallel.Isolated; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -33,7 +32,6 @@ import de.tum.in.www1.artemis.user.UserUtilService; @Isolated -@Order(Integer.MAX_VALUE) class QuizCacheTest extends AbstractSpringIntegrationTest { private static final String TEST_PREFIX = "quizcachetest"; diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties index 05917f24e407..a2754a0609bb 100644 --- a/src/test/resources/junit-platform.properties +++ b/src/test/resources/junit-platform.properties @@ -1,8 +1,8 @@ # Enables junit5 parallel test execution. Tests are run on one JVM instance. junit.jupiter.execution.parallel.enabled = true -# Enables ordering test-classes with JUnit5 by @Order annotation (Used to start integration tests before unit tests). -junit.jupiter.testclass.order.default = org.junit.jupiter.api.ClassOrderer$OrderAnnotation +# Enables ordering test-classes with JUnit5 by class name. +junit.jupiter.testclass.order.default = org.junit.jupiter.api.ClassOrderer$ClassName # Enables JUnit5 automatic detection of extensions. junit.jupiter.extensions.autodetection.enabled = true From f4a0b73f2e94ddd9cbb28bcbee5cfa9cad9dba1f Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 18 Sep 2023 14:57:12 +0200 Subject: [PATCH 44/60] Please work -.- --- .../NotificationScheduleServiceTest.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java index db3749f2f846..6571cb625394 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationScheduleServiceTest.java @@ -19,12 +19,9 @@ import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; -import de.tum.in.www1.artemis.exercise.ExerciseUtilService; +import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseFactory; import de.tum.in.www1.artemis.participation.ParticipationUtilService; -import de.tum.in.www1.artemis.repository.ExerciseRepository; -import de.tum.in.www1.artemis.repository.NotificationRepository; -import de.tum.in.www1.artemis.repository.NotificationSettingRepository; -import de.tum.in.www1.artemis.repository.ResultRepository; +import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.service.messaging.InstanceMessageReceiveService; import de.tum.in.www1.artemis.user.UserUtilService; @@ -53,9 +50,6 @@ class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILo @Autowired private CourseUtilService courseUtilService; - @Autowired - private ExerciseUtilService exerciseUtilService; - @Autowired private ParticipationUtilService participationUtilService; @@ -66,7 +60,7 @@ class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILo private long sizeBefore; // TODO: This could be improved by e.g. manually setting the system time instead of waiting for actual time to pass. - private static final long DELAY_MS = 1000; + private static final long DELAY_MS = 200; private static final long TIMEOUT_MS = 5000; @@ -74,8 +68,10 @@ class NotificationScheduleServiceTest extends AbstractSpringIntegrationLocalCILo void init() { userUtilService.addUsers(TEST_PREFIX, 1, 1, 1, 1); user = userUtilService.getUserByLogin(TEST_PREFIX + "student1"); - final Course course = courseUtilService.addCourseWithModelingAndTextExercise(); - exercise = exerciseUtilService.getFirstExerciseWithType(course, TextExercise.class); + final Course course = courseUtilService.addEmptyCourse(); + exercise = TextExerciseFactory.generateTextExercise(null, null, null, course); + exercise.setMaxPoints(5.0); + exerciseRepository.saveAndFlush(exercise); doNothing().when(javaMailSender).send(any(MimeMessage.class)); sizeBefore = notificationRepository.count(); From 1030ef72cd63cd26c04442a049227b157cd2d4f5 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:49:09 +0200 Subject: [PATCH 45/60] Filter Maven Blackbox tests from TemplateIntegrationTest Maven Blackbox templates were not tested before, as this Project Type is not supported by Bamboo Bitbucket Jira. Since the TestGroup for ProgrammingExerciseTemplateIntegrationTest changed, the tests were also executed for Maven Blackbox and failed to succeed. We now skip this project type since its templates were not tested before. Nonetheless we should test this project type's templates in the future. --- .../ProgrammingExerciseTemplateIntegrationTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java index 1737a16c054c..38d22ca050d9 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseTemplateIntegrationTest.java @@ -149,6 +149,10 @@ private Stream languageTypeBuilder() { argumentBuilder.add(Arguments.of(language, null, false)); } for (ProjectType projectType : projectTypes) { + // TODO: MAVEN_BLACKBOX Templates should be tested in the future! + if (projectType == ProjectType.MAVEN_BLACKBOX) { + continue; + } argumentBuilder.add(Arguments.of(language, projectType, false)); } @@ -157,6 +161,9 @@ private Stream languageTypeBuilder() { argumentBuilder.add(Arguments.of(language, null, true)); } for (ProjectType projectType : projectTypes) { + if (projectType == ProjectType.MAVEN_BLACKBOX) { + continue; + } argumentBuilder.add(Arguments.of(language, projectType, true)); } } From 877fb5c55eb8887b8568ba89ec0cd7041dbb58af Mon Sep 17 00:00:00 2001 From: lara Date: Mon, 18 Sep 2023 16:39:09 +0200 Subject: [PATCH 46/60] please work 2 --- .../service/scheduled/NotificationScheduleService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java b/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java index e46cc1c87abe..759b08b077d6 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java +++ b/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java @@ -164,8 +164,8 @@ private void scheduleNotificationForAssessedExercisesSubmissions(Exercise exerci * @return true if the time is valid else false */ private boolean checkIfTimeIsCorrectForScheduledTask(ZonedDateTime relevantTime) { - // only send a notification if relevantTime is defined and not in the future (i.e. in the range [now-2 minutes, now]) (due to possible delays in scheduling) - return relevantTime != null && !relevantTime.isBefore(ZonedDateTime.now().minusMinutes(2)) && !relevantTime.isAfter(ZonedDateTime.now()); + // only send a notification if relevantTime is defined and not in the future (i.e. in the range [now-2 minutes, now+2 minutes]) (due to possible delays in scheduling) + return relevantTime != null && !relevantTime.isBefore(ZonedDateTime.now().minusMinutes(2)) && !relevantTime.isAfter(ZonedDateTime.now().plusMinutes(2)); } /** From 42e9954e4f233f9810f0eb4059ed226e880bde9d Mon Sep 17 00:00:00 2001 From: lara Date: Mon, 18 Sep 2023 18:06:21 +0200 Subject: [PATCH 47/60] add await in testGetExerciseStatsForCourseOverview --- .../in/www1/artemis/course/CourseTestService.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java index 160fe41cc406..ed57ecac1c1d 100644 --- a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java +++ b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java @@ -5,7 +5,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.awaitility.Awaitility.await; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.argThat; +import static org.mockito.Mockito.mockStatic; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.io.IOException; @@ -67,12 +68,15 @@ import de.tum.in.www1.artemis.repository.metis.conversation.ChannelRepository; import de.tum.in.www1.artemis.repository.metis.conversation.ConversationRepository; import de.tum.in.www1.artemis.security.SecurityUtils; -import de.tum.in.www1.artemis.service.*; +import de.tum.in.www1.artemis.service.FilePathService; +import de.tum.in.www1.artemis.service.FileService; +import de.tum.in.www1.artemis.service.ParticipationService; import de.tum.in.www1.artemis.service.dto.StudentDTO; import de.tum.in.www1.artemis.service.dto.UserDTO; import de.tum.in.www1.artemis.service.dto.UserPublicInfoDTO; import de.tum.in.www1.artemis.service.export.CourseExamExportService; import de.tum.in.www1.artemis.service.notifications.GroupNotificationService; +import de.tum.in.www1.artemis.service.scheduled.ParticipantScoreScheduleService; import de.tum.in.www1.artemis.team.TeamUtilService; import de.tum.in.www1.artemis.user.UserFactory; import de.tum.in.www1.artemis.user.UserUtilService; @@ -209,6 +213,9 @@ public class CourseTestService { @Autowired private LearningPathRepository learningPathRepository; + @Autowired + private ParticipantScoreScheduleService participantScoreScheduleService; + private static final int numberOfStudents = 8; private static final int numberOfTutors = 5; @@ -2419,6 +2426,7 @@ public void testGetExerciseStatsForCourseOverview() throws Exception { await().until(() -> !participantScoreRepository.findAllByExercise(finalExerciseInAssessment).isEmpty()); TextExercise finalExerciseAssessmentDone = exerciseAssessmentDone; await().until(() -> !participantScoreRepository.findAllByExercise(finalExerciseAssessmentDone).isEmpty()); + await().until(() -> participantScoreScheduleService.isIdle()); var courseDtos = request.getList("/api/courses/stats-for-management-overview", HttpStatus.OK, CourseManagementOverviewStatisticsDTO.class); // We only added one course, so expect one dto From af32e4647a66825ed0ab7009f86a793bc778e85e Mon Sep 17 00:00:00 2001 From: lara Date: Mon, 18 Sep 2023 22:37:02 +0200 Subject: [PATCH 48/60] add new quiz tests --- .../QuizSubmissionWebsocketService.java | 27 ++---------- .../QuizExerciseIntegrationTest.java | 18 ++++++++ .../quizexercise/QuizExerciseUtilService.java | 36 ++-------------- .../QuizSubmissionIntegrationTest.java | 43 +++++++++++++++++-- 4 files changed, 65 insertions(+), 59 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/web/websocket/QuizSubmissionWebsocketService.java b/src/main/java/de/tum/in/www1/artemis/web/websocket/QuizSubmissionWebsocketService.java index e394a3863d1f..8aac25aa6091 100644 --- a/src/main/java/de/tum/in/www1/artemis/web/websocket/QuizSubmissionWebsocketService.java +++ b/src/main/java/de/tum/in/www1/artemis/web/websocket/QuizSubmissionWebsocketService.java @@ -4,8 +4,6 @@ import javax.validation.Valid; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.messaging.handler.annotation.DestinationVariable; import org.springframework.messaging.handler.annotation.MessageMapping; import org.springframework.messaging.handler.annotation.Payload; @@ -14,13 +12,12 @@ import de.tum.in.www1.artemis.domain.quiz.QuizSubmission; import de.tum.in.www1.artemis.exception.QuizSubmissionException; import de.tum.in.www1.artemis.security.SecurityUtils; -import de.tum.in.www1.artemis.service.*; +import de.tum.in.www1.artemis.service.QuizSubmissionService; +import de.tum.in.www1.artemis.service.WebsocketMessagingService; @Controller public class QuizSubmissionWebsocketService { - private static final Logger log = LoggerFactory.getLogger(QuizSubmissionWebsocketService.class); - private final QuizSubmissionService quizSubmissionService; private final WebsocketMessagingService websocketMessagingService; @@ -45,29 +42,11 @@ public void saveSubmission(@DestinationVariable Long exerciseId, @Valid @Payload // Without this, custom jpa repository methods don't work in websocket channel. SecurityUtils.setAuthorizationObject(); try { - QuizSubmission updatedQuizSubmission = quizSubmissionService.saveSubmissionForLiveMode(exerciseId, quizSubmission, principal.getName(), false); - // send updated submission over websocket (use a thread to prevent that the outbound channel blocks the inbound channel (e.g. due a slow client)) - // to improve the performance, this is currently deactivated: slow clients might lead to bottlenecks so that more important messages can not be distributed any more - // new Thread(() -> sendSubmissionToUser(username, exerciseId, quizSubmission)).start(); - - // log.info("WS.Inbound: Sent quiz submission (async) back to user {} in quiz {} after {} µs ", principal.getName(), exerciseId, (System.nanoTime() - start) / 1000); + quizSubmissionService.saveSubmissionForLiveMode(exerciseId, quizSubmission, principal.getName(), false); } catch (QuizSubmissionException ex) { // send error message over websocket (use Async to prevent that the outbound channel blocks the inbound channel (e.g. due a slow client)) websocketMessagingService.sendMessageToUser(principal.getName(), "/topic/quizExercise/" + exerciseId + "/submission", new WebsocketError(ex.getMessage())); } } - - /** - * Should be invoked using a thread asynchronously - * - * @param username the user who saved / submitted the quiz submission - * @param exerciseId the quiz exercise id - * @param quizSubmission the quiz submission that is returned back to the user - */ - private void sendSubmissionToUser(String username, Long exerciseId, QuizSubmission quizSubmission) { - long start = System.nanoTime(); - websocketMessagingService.sendMessageToUser(username, "/topic/quizExercise/" + exerciseId + "/submission", quizSubmission); - log.info("WS.Outbound: Sent quiz submission to user {} in quiz {} in {} µs ", username, exerciseId, (System.nanoTime() - start) / 1000); - } } diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java index bf5e5e9e4d74..31387743ff2d 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java @@ -823,6 +823,24 @@ void testReEvaluateQuizQuestionWithMoreSolutions() throws Exception { assertThat(receivedShortAnswerQuestion.getCorrectMappings()).hasSize(3); } + @Test + @WithMockUser(username = TEST_PREFIX + "tutor1", roles = "TA") + void testAddAndStartQuizBatch() throws Exception { + QuizExercise quizExercise = quizExerciseUtilService.createAndSaveQuiz(ZonedDateTime.now().plusHours(5), null, QuizMode.BATCHED); + + QuizBatch batch = request.putWithResponseBody("/api/quiz-exercises/" + quizExercise.getId() + "/add-batch", null, QuizBatch.class, HttpStatus.OK); + request.put("/api/quiz-exercises/" + batch.getId() + "/start-batch", null, HttpStatus.OK); + } + + @Test + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + void testAddAndStartQuizBatch_AsStudentNotAllowed() throws Exception { + QuizExercise quizExercise = quizExerciseUtilService.createAndSaveQuiz(ZonedDateTime.now().plusHours(5), null, QuizMode.BATCHED); + + request.putWithResponseBody("/api/quiz-exercises/" + quizExercise.getId() + "/add-batch", null, QuizBatch.class, HttpStatus.FORBIDDEN); + request.put("/api/quiz-exercises/" + null + "/start-batch", null, HttpStatus.BAD_REQUEST); + } + @Test @WithMockUser(username = TEST_PREFIX + "instructor1", roles = "INSTRUCTOR") void testPerformStartNow() throws Exception { diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java index 76429a21d3a5..2b78e0470607 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java @@ -13,18 +13,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; import de.tum.in.www1.artemis.course.CourseFactory; import de.tum.in.www1.artemis.course.CourseUtilService; -import de.tum.in.www1.artemis.domain.Course; -import de.tum.in.www1.artemis.domain.Team; -import de.tum.in.www1.artemis.domain.TeamAssignmentConfig; -import de.tum.in.www1.artemis.domain.User; -import de.tum.in.www1.artemis.domain.enumeration.*; +import de.tum.in.www1.artemis.domain.*; +import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; +import de.tum.in.www1.artemis.domain.enumeration.QuizMode; +import de.tum.in.www1.artemis.domain.enumeration.SubmissionType; import de.tum.in.www1.artemis.domain.exam.Exam; import de.tum.in.www1.artemis.domain.exam.ExerciseGroup; import de.tum.in.www1.artemis.domain.participation.StudentParticipation; @@ -36,7 +32,6 @@ import de.tum.in.www1.artemis.service.scheduled.cache.quiz.QuizScheduleService; import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.RequestUtilService; -import de.tum.in.www1.artemis.web.rest.dto.QuizBatchJoinDTO; /** * Service responsible for initializing the database with specific testdata related to quiz exercises for use in integration tests. @@ -98,29 +93,6 @@ public class QuizExerciseUtilService { @Autowired private QuizScheduleService quizScheduleService; - /** - * Create, join and start a batch for student by tutor - */ - public void prepareBatchForSubmitting(QuizExercise quizExercise, Authentication tutor, Authentication student) throws Exception { - var authentication = SecurityContextHolder.getContext().getAuthentication(); - switch (quizExercise.getQuizMode()) { - case SYNCHRONIZED -> { - } - case BATCHED -> { - SecurityContextHolder.getContext().setAuthentication(tutor); - var batch = requestUtilService.putWithResponseBody("/api/quiz-exercises/" + quizExercise.getId() + "/add-batch", null, QuizBatch.class, HttpStatus.OK); - requestUtilService.put("/api/quiz-exercises/" + batch.getId() + "/start-batch", null, HttpStatus.OK); - SecurityContextHolder.getContext().setAuthentication(student); - requestUtilService.postWithoutLocation("/api/quiz-exercises/" + quizExercise.getId() + "/join", new QuizBatchJoinDTO(batch.getPassword()), HttpStatus.OK, null); - } - case INDIVIDUAL -> { - SecurityContextHolder.getContext().setAuthentication(student); - requestUtilService.postWithoutLocation("/api/quiz-exercises/" + quizExercise.getId() + "/join", new QuizBatchJoinDTO(null), HttpStatus.OK, null); - } - } - SecurityContextHolder.getContext().setAuthentication(authentication); - } - public Course addCourseWithOneQuizExercise() { return addCourseWithOneQuizExercise("Title"); } diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index 3ab976709533..f25c19aed132 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -4,10 +4,13 @@ import static org.awaitility.Awaitility.await; import static org.mockito.Mockito.*; +import java.security.Principal; import java.time.Duration; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -38,6 +41,7 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.service.QuizStatisticService; import de.tum.in.www1.artemis.user.UserUtilService; +import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILocalVCTest { @@ -108,7 +112,41 @@ protected void resetSpyBeans() { @Test @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") - void testQuizSubmit() { + void testQuizSubmitWebsocket() { + QuizExercise quizExercise = setupQuizExerciseParameters(); + quizExercise = quizExerciseService.save(quizExercise); + + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, false, null); + + String username = TEST_PREFIX + "student1"; + Principal principal = () -> username; + + quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); + verify(websocketMessagingService, never()).sendMessageToUser(eq(username), any(), any()); + } + + @Test + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + void testQuizSubmitUnactiveQuizWebsocket() { + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().plusDays(1), null, QuizMode.SYNCHRONIZED); + quizExercise.duration(240); + quizExerciseRepository.save(quizExercise); + + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, false, null); + + String username = TEST_PREFIX + "student1"; + Principal principal = () -> username; + + quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); + verify(websocketMessagingService).sendMessageToUser(eq(username), any(), any()); + } + + @Autowired + QuizSubmissionWebsocketService quizSubmissionWebsocketService; + + @Test + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + void testQuizSubmit_CalculateScore() { QuizExercise quizExercise = setupQuizExerciseParameters(); quizExercise = quizExerciseService.save(quizExercise); @@ -120,7 +158,6 @@ void testQuizSubmit() { quizSubmission.setSubmitted(true); participationUtilService.addSubmission(quizExercise, quizSubmission, TEST_PREFIX + "student" + i); participationUtilService.addResultToSubmission(quizSubmission, AssessmentType.AUTOMATIC, null, quizExercise.getScoreForSubmission(quizSubmission), true); - } // check first half of the submissions From d4051ca264de881bfe5667d9e37eea7fb76f1ee3 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Mon, 18 Sep 2023 23:42:50 +0200 Subject: [PATCH 49/60] Test isolation of two QuizSubmissionIntegrationTests --- .../QuizSubmissionIntegrationTest.java | 112 +++++++++--------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java index f25c19aed132..c5290695b2b2 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizSubmissionIntegrationTest.java @@ -12,9 +12,8 @@ import java.util.Arrays; import java.util.List; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.Isolated; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.ValueSource; @@ -98,6 +97,9 @@ class QuizSubmissionIntegrationTest extends AbstractSpringIntegrationLocalCILoca @Autowired ParticipationUtilService participationUtilService; + @Autowired + QuizSubmissionWebsocketService quizSubmissionWebsocketService; + @BeforeEach void init() { // do not use the schedule service based on a time interval in the tests, because this would result in flaky tests that run much slower @@ -141,9 +143,6 @@ void testQuizSubmitUnactiveQuizWebsocket() { verify(websocketMessagingService).sendMessageToUser(eq(username), any(), any()); } - @Autowired - QuizSubmissionWebsocketService quizSubmissionWebsocketService; - @Test @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") void testQuizSubmit_CalculateScore() { @@ -309,34 +308,6 @@ else if (pointCounter.getPoints() == 6.0) { } } - @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") - @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") - @EnumSource(QuizMode.class) - void testQuizSubmitLiveMode(QuizMode quizMode) throws Exception { - QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(2), null, quizMode); - quizExercise.setDuration(600); - quizExercise = quizExerciseService.save(quizExercise); - - // at the beginning there are no submissions and no participants - assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).isEmpty(); - assertThat(participationRepository.findByExerciseId(quizExercise.getId())).isEmpty(); - - if (quizMode != QuizMode.SYNCHRONIZED) { - var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusSeconds(10))); - quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student1"); - } - - QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, false, null); - QuizSubmission updatedSubmission = request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, QuizSubmission.class, - HttpStatus.OK); - // check whether submission flag was updated - assertThat(updatedSubmission.isSubmitted()).isTrue(); - // check whether all answers were submitted properly - assertThat(updatedSubmission.getSubmittedAnswers()).hasSameSizeAs(quizSubmission.getSubmittedAnswers()); - // check whether submission date was set - assertThat(updatedSubmission.getSubmissionDate()).isNotNull(); - } - @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") @WithMockUser(username = TEST_PREFIX + "student4", roles = "USER") @EnumSource(QuizMode.class) @@ -359,26 +330,6 @@ void testQuizSubmitLiveMode_badRequest_notActive(QuizMode quizMode) throws Excep } } - @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") - @WithMockUser(username = TEST_PREFIX + "student3", roles = "USER") - @EnumSource(QuizMode.class) - void testQuizSubmitLiveMode_badRequest_alreadySubmitted(QuizMode quizMode) throws Exception { - QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusSeconds(5), ZonedDateTime.now().plusSeconds(10), quizMode); - quizExercise.setDuration(10); - quizExercise = quizExerciseService.save(quizExercise); - - if (quizMode != QuizMode.SYNCHRONIZED) { - var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusSeconds(5))); - quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student3"); - } - - // create a submission for the first time - QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, ZonedDateTime.now()); - quizScheduleService.updateSubmission(quizExercise.getId(), TEST_PREFIX + "student3", quizSubmission); - // submit quiz for the second time, expected status = BAD_REQUEST - request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, Result.class, HttpStatus.BAD_REQUEST); - } - @Test @WithMockUser(username = TEST_PREFIX + "student3", roles = "USER") void testQuizSubmitEmptyQuizInLiveMode() throws Exception { @@ -823,4 +774,57 @@ private QuizExercise setupQuizExerciseParameters() { quizExercise.duration(240); return quizExercise; } + + @Nested + @Isolated + class QuizSubmitLiveModeIsolatedTest { + + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + @EnumSource(QuizMode.class) + void testQuizSubmitLiveMode(QuizMode quizMode) throws Exception { + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(2), null, quizMode); + quizExercise.setDuration(600); + quizExercise = quizExerciseService.save(quizExercise); + + // at the beginning there are no submissions and no participants + assertThat(quizSubmissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).isEmpty(); + assertThat(participationRepository.findByExerciseId(quizExercise.getId())).isEmpty(); + + if (quizMode != QuizMode.SYNCHRONIZED) { + var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusSeconds(10))); + quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student1"); + } + + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, false, null); + QuizSubmission updatedSubmission = request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, QuizSubmission.class, + HttpStatus.OK); + // check whether submission flag was updated + assertThat(updatedSubmission.isSubmitted()).isTrue(); + // check whether all answers were submitted properly + assertThat(updatedSubmission.getSubmittedAnswers()).hasSameSizeAs(quizSubmission.getSubmittedAnswers()); + // check whether submission date was set + assertThat(updatedSubmission.getSubmissionDate()).isNotNull(); + } + + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") + @WithMockUser(username = TEST_PREFIX + "student3", roles = "USER") + @EnumSource(QuizMode.class) + void testQuizSubmitLiveMode_badRequest_alreadySubmitted(QuizMode quizMode) throws Exception { + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusSeconds(5), ZonedDateTime.now().plusSeconds(10), quizMode); + quizExercise.setDuration(10); + quizExercise = quizExerciseService.save(quizExercise); + + if (quizMode != QuizMode.SYNCHRONIZED) { + var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusSeconds(5))); + quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student3"); + } + + // create a submission for the first time + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, ZonedDateTime.now()); + quizScheduleService.updateSubmission(quizExercise.getId(), TEST_PREFIX + "student3", quizSubmission); + // submit quiz for the second time, expected status = BAD_REQUEST + request.postWithResponseBody("/api/exercises/" + quizExercise.getId() + "/submissions/live", quizSubmission, Result.class, HttpStatus.BAD_REQUEST); + } + } } From 94b1aeff5d3aa252c6b8f4b0706e9a3321fa415c Mon Sep 17 00:00:00 2001 From: lara Date: Tue, 19 Sep 2023 13:28:29 +0200 Subject: [PATCH 50/60] add await to testGetCourseManagementDetailData --- .../java/de/tum/in/www1/artemis/course/CourseTestService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java index ed57ecac1c1d..4bd3aca7e413 100644 --- a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java +++ b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java @@ -2426,7 +2426,6 @@ public void testGetExerciseStatsForCourseOverview() throws Exception { await().until(() -> !participantScoreRepository.findAllByExercise(finalExerciseInAssessment).isEmpty()); TextExercise finalExerciseAssessmentDone = exerciseAssessmentDone; await().until(() -> !participantScoreRepository.findAllByExercise(finalExerciseAssessmentDone).isEmpty()); - await().until(() -> participantScoreScheduleService.isIdle()); var courseDtos = request.getList("/api/courses/stats-for-management-overview", HttpStatus.OK, CourseManagementOverviewStatisticsDTO.class); // We only added one course, so expect one dto @@ -2710,6 +2709,7 @@ public void testGetCourseManagementDetailData() throws Exception { request.putWithResponseBody("/api/participations/" + result2.getSubmission().getParticipation().getId() + "/submissions/" + result2.getSubmission().getId() + "/text-assessment-after-complaint", feedbackUpdate, Result.class, HttpStatus.OK); + await().until(participantScoreScheduleService::isIdle); TextExercise finalExercise1 = exercise1; await().until(() -> participantScoreRepository.findAllByExercise(finalExercise1).size() == 2); TextExercise finalExercise2 = exercise2; From a95cd182d04e1faac47ce666208b44057a42f700 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:18:39 +0200 Subject: [PATCH 51/60] Fix mockUpdatePlanRepository() after merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why did GitHub Actions already fail with the same reason before merging develop? 👀👻 --- ...ava => AbstractSpringIntegrationIndependentTest.java} | 9 ++++----- .../java/de/tum/in/www1/artemis/ClientForwardTest.java | 2 +- .../in/www1/artemis/ContentVersionIntegrationTest.java | 2 +- .../de/tum/in/www1/artemis/DatabaseQueryCountTest.java | 2 +- .../java/de/tum/in/www1/artemis/FileIntegrationTest.java | 2 +- .../in/www1/artemis/GuidedTourSettingResourceTest.java | 2 +- .../in/www1/artemis/ImprintResourceIntegrationTest.java | 2 +- .../tum/in/www1/artemis/LogResourceIntegrationTest.java | 2 +- .../artemis/LongFeedbackResourceIntegrationTest.java | 2 +- .../tum/in/www1/artemis/Lti13LaunchIntegrationTest.java | 2 +- .../tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java | 2 +- .../artemis/PrivacyStatementResourceIntegrationTest.java | 2 +- .../tum/in/www1/artemis/StatisticsIntegrationTest.java | 2 +- .../assessment/AssessmentComplaintIntegrationTest.java | 4 ++-- .../AssessmentTeamComplaintIntegrationTest.java | 4 ++-- .../assessment/ComplaintResponseIntegrationTest.java | 4 ++-- .../assessment/ExampleSubmissionIntegrationTest.java | 4 ++-- .../assessment/ExerciseScoresChartIntegrationTest.java | 4 ++-- .../artemis/assessment/GradeStepIntegrationTest.java | 4 ++-- .../artemis/assessment/GradingScaleIntegrationTest.java | 4 ++-- .../assessment/RatingResourceIntegrationTest.java | 4 ++-- .../artemis/assessment/TutorEffortIntegrationTest.java | 4 ++-- .../TutorLeaderboardServiceIntegrationTest.java | 4 ++-- .../assessment/TutorParticipationIntegrationTest.java | 4 ++-- .../TutorParticipationResourceIntegrationTest.java | 4 ++-- .../tum/in/www1/artemis/bonus/BonusIntegrationTest.java | 4 ++-- .../artemis/config/TopicSubscriptionInterceptorTest.java | 4 ++-- .../java/de/tum/in/www1/artemis/domain/ExerciseTest.java | 4 ++-- .../java/de/tum/in/www1/artemis/domain/ResultTest.java | 4 ++-- .../in/www1/artemis/exam/ExamSessionIntegrationTest.java | 4 ++-- .../www1/artemis/exercise/ExerciseIntegrationTest.java | 4 ++-- .../FileUploadAssessmentIntegrationTest.java | 4 ++-- .../FileUploadExerciseIntegrationTest.java | 4 ++-- .../FileUploadSubmissionIntegrationTest.java | 4 ++-- .../ApollonDiagramResourceIntegrationTest.java | 4 ++-- .../exercise/programmingexercise/GitServiceTest.java | 4 ++-- .../programmingexercise/PlantUmlIntegrationTest.java | 4 ++-- .../ProgrammingAssessmentIntegrationTest.java | 4 ++-- .../ProgrammingExerciseGitIntegrationTest.java | 4 ++-- .../ProgrammingExerciseParticipationIntegrationTest.java | 4 ++-- .../ProgrammingExerciseRepositoryServiceTest.java | 4 ++-- .../ProgrammingExerciseScheduleServiceTest.java | 9 +-------- .../ProgrammingExerciseServiceTest.java | 4 ++-- .../quizexercise/QuizExerciseIntegrationTest.java | 4 ++-- .../in/www1/artemis/hestia/CodeHintIntegrationTest.java | 4 ++-- .../tum/in/www1/artemis/hestia/CodeHintServiceTest.java | 4 ++-- .../www1/artemis/hestia/ExerciseHintIntegrationTest.java | 4 ++-- .../in/www1/artemis/hestia/ExerciseHintServiceTest.java | 4 ++-- .../tum/in/www1/artemis/hestia/HestiaDatabaseTest.java | 4 ++-- .../ProgrammingExerciseSolutionEntryIntegrationTest.java | 4 ++-- .../hestia/ProgrammingExerciseTaskIntegrationTest.java | 4 ++-- .../hestia/ProgrammingExerciseTaskServiceTest.java | 4 ++-- .../artemis/hestia/TestwiseCoverageIntegrationTest.java | 4 ++-- .../lecture/AttachmentResourceIntegrationTest.java | 4 ++-- .../artemis/lecture/AttachmentUnitIntegrationTest.java | 4 ++-- .../artemis/lecture/AttachmentUnitsIntegrationTest.java | 4 ++-- .../artemis/lecture/ExerciseUnitIntegrationTest.java | 4 ++-- .../in/www1/artemis/lecture/LectureIntegrationTest.java | 4 ++-- .../www1/artemis/lecture/LectureUnitIntegrationTest.java | 4 ++-- .../www1/artemis/lecture/OnlineUnitIntegrationTest.java | 4 ++-- .../in/www1/artemis/lecture/TextUnitIntegrationTest.java | 4 ++-- .../www1/artemis/lecture/VideoUnitIntegrationTest.java | 4 ++-- .../in/www1/artemis/metis/AbstractConversationTest.java | 4 ++-- .../www1/artemis/metis/AnswerMessageIntegrationTest.java | 4 ++-- .../in/www1/artemis/metis/AnswerPostIntegrationTest.java | 4 ++-- .../in/www1/artemis/metis/MessageIntegrationTest.java | 4 ++-- .../in/www1/artemis/metis/ReactionIntegrationTest.java | 4 ++-- .../www1/artemis/migration/MigrationIntegrityTest.java | 4 ++-- .../in/www1/artemis/migration/MigrationServiceTest.java | 4 ++-- .../notification/GroupNotificationServiceTest.java | 4 ++-- .../NotificationResourceIntegrationTest.java | 4 ++-- .../NotificationSettingsResourceIntegrationTest.java | 4 ++-- .../notification/NotificationSettingsServiceTest.java | 4 ++-- .../notification/PushNotificationResourceTest.java | 4 ++-- .../notification/SingleUserNotificationServiceTest.java | 4 ++-- .../notification/SystemNotificationIntegrationTest.java | 4 ++-- .../ParticipationSubmissionIntegrationTest.java | 4 ++-- .../participation/SubmissionExportIntegrationTest.java | 4 ++-- .../artemis/participation/SubmissionIntegrationTest.java | 4 ++-- .../plagiarism/PlagiarismCaseIntegrationTest.java | 4 ++-- .../plagiarism/PlagiarismCheckIntegrationTest.java | 4 ++-- .../artemis/plagiarism/PlagiarismIntegrationTest.java | 4 ++-- .../artemis/repository/StatisticsRepositoryTest.java | 4 ++-- .../in/www1/artemis/service/AssessmentServiceTest.java | 4 ++-- .../www1/artemis/service/BuildLogEntryServiceTest.java | 4 ++-- .../artemis/service/ComplaintResponseServiceTest.java | 4 ++-- .../service/CourseScoreCalculationServiceTest.java | 4 ++-- .../in/www1/artemis/service/EmailSummaryServiceTest.java | 4 ++-- .../in/www1/artemis/service/ExerciseDateServiceTest.java | 4 ++-- .../artemis/service/ExerciseLifecycleServiceTest.java | 4 ++-- .../www1/artemis/service/FeatureToggleServiceTest.java | 4 ++-- .../tum/in/www1/artemis/service/FeedbackServiceTest.java | 4 ++-- .../de/tum/in/www1/artemis/service/FileServiceTest.java | 4 ++-- .../in/www1/artemis/service/GradingScaleServiceTest.java | 4 ++-- .../www1/artemis/service/LectureImportServiceTest.java | 4 ++-- .../tum/in/www1/artemis/service/LectureServiceTest.java | 4 ++-- .../ParticipationAuthorizationCheckServiceTest.java | 4 ++-- .../service/ParticipationLifecycleServiceTest.java | 4 ++-- .../service/ParticipationTeamWebsocketServiceTest.java | 4 ++-- .../PresentationPointsCalculationServiceTest.java | 4 ++-- .../www1/artemis/service/ResourceLoaderServiceTest.java | 4 ++-- .../tum/in/www1/artemis/service/ResultServiceTest.java | 4 ++-- .../in/www1/artemis/service/SubmissionServiceTest.java | 4 ++-- .../www1/artemis/service/TeamWebsocketServiceTest.java | 4 ++-- .../artemis/service/TitleCacheEvictionServiceTest.java | 4 ++-- .../de/tum/in/www1/artemis/service/UrlServiceTest.java | 4 ++-- .../tum/in/www1/artemis/service/ZipFileServiceTest.java | 4 ++-- .../www1/artemis/service/exam/ExamAccessServiceTest.java | 4 ++-- .../www1/artemis/service/exam/ExamQuizServiceTest.java | 4 ++-- .../in/www1/artemis/service/exam/ExamServiceTest.java | 4 ++-- .../artemis/service/exam/ExamSubmissionServiceTest.java | 4 ++-- .../service/exam/StudentExamAccessServiceTest.java | 4 ++-- .../ConversationNotificationServiceTest.java | 4 ++-- .../TutorialGroupNotificationServiceTest.java | 4 ++-- .../ProgrammingExerciseFeedbackCreationServiceTest.java | 4 ++-- ...otificationDeviceConfigurationCleanupServiceTest.java | 4 ++-- .../service/scheduled/cache/quiz/QuizCacheTest.java | 4 ++-- .../in/www1/artemis/team/TeamImportIntegrationTest.java | 4 ++-- .../de/tum/in/www1/artemis/team/TeamIntegrationTest.java | 4 ++-- .../artemis/text/AssessmentEventIntegrationTest.java | 4 ++-- .../www1/artemis/text/TextExerciseIntegrationTest.java | 4 ++-- .../www1/artemis/text/TextSubmissionIntegrationTest.java | 4 ++-- .../junit_parallel_logging/ParallelConsoleAppender.java | 2 +- .../web/rest/AndroidAppSiteAssociationResourceTest.java | 4 ++-- .../web/rest/AppleAppSiteAssociationResourceTest.java | 4 ++-- 125 files changed, 238 insertions(+), 246 deletions(-) rename src/test/java/de/tum/in/www1/artemis/{AbstractSpringIntegrationTest.java => AbstractSpringIntegrationIndependentTest.java} (98%) diff --git a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationIndependentTest.java similarity index 98% rename from src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java rename to src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationIndependentTest.java index f722ca7354e8..f1e0b8343697 100644 --- a/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/AbstractSpringIntegrationIndependentTest.java @@ -2,7 +2,6 @@ import static tech.jhipster.config.JHipsterConstants.SPRING_PROFILE_TEST; -import java.util.List; import java.util.Set; import org.junit.jupiter.api.AfterEach; @@ -33,12 +32,12 @@ @AutoConfigureMockMvc @ExtendWith(SpringExtension.class) @Execution(ExecutionMode.CONCURRENT) -@ResourceLock("AbstractSpringIntegrationTest") +@ResourceLock("AbstractSpringIntegrationIndependentTest") @AutoConfigureEmbeddedDatabase // NOTE: we use a common set of active profiles to reduce the number of application launches during testing. This significantly saves time and memory! @ActiveProfiles({ SPRING_PROFILE_TEST, "artemis", "scheduling" }) @TestPropertySource(properties = { "artemis.user-management.use-external=false" }) -public abstract class AbstractSpringIntegrationTest extends AbstractArtemisIntegrationTest { +public abstract class AbstractSpringIntegrationIndependentTest extends AbstractArtemisIntegrationTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); @@ -84,8 +83,8 @@ public void mockUpdatePlanRepositoryForParticipation(ProgrammingExercise exercis } @Override - public void mockUpdatePlanRepository(ProgrammingExercise exercise, String planName, String repoNameInCI, String repoNameInVcs, List triggeredBy) { - log.debug("Called mockUpdatePlanRepository with args {}, {}, {}, {}, {}", exercise, planName, repoNameInCI, repoNameInVcs, triggeredBy); + public void mockUpdatePlanRepository(ProgrammingExercise exercise, String planName, String repoNameInCI, String repoNameInVcs) { + log.debug("Called mockUpdatePlanRepository with args {}, {}, {}, {}", exercise, planName, repoNameInCI, repoNameInVcs); } @Override diff --git a/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java b/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java index 80a428e774f9..452ff334c92c 100644 --- a/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java +++ b/src/test/java/de/tum/in/www1/artemis/ClientForwardTest.java @@ -20,7 +20,7 @@ * * @see ClientForwardResource */ -class ClientForwardTest extends AbstractSpringIntegrationTest { +class ClientForwardTest extends AbstractSpringIntegrationIndependentTest { @Autowired private JWTCookieService jwtCookieService; diff --git a/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java index 5da15879a738..98e1a3805c85 100644 --- a/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/ContentVersionIntegrationTest.java @@ -15,7 +15,7 @@ import de.tum.in.www1.artemis.config.ApiVersionFilter; import de.tum.in.www1.artemis.user.UserUtilService; -class ContentVersionIntegrationTest extends AbstractSpringIntegrationTest { +class ContentVersionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "contentversion"; diff --git a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java index 403e9e1a1114..060dac060f74 100644 --- a/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java +++ b/src/test/java/de/tum/in/www1/artemis/DatabaseQueryCountTest.java @@ -17,7 +17,7 @@ import de.tum.in.www1.artemis.exam.ExamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class DatabaseQueryCountTest extends AbstractSpringIntegrationTest { +class DatabaseQueryCountTest extends AbstractSpringIntegrationIndependentTest { private final Logger log = LoggerFactory.getLogger(this.getClass()); diff --git a/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java index 761920f7b13a..ab1cef3d3679 100644 --- a/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/FileIntegrationTest.java @@ -41,7 +41,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class FileIntegrationTest extends AbstractSpringIntegrationTest { +class FileIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "fileintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java b/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java index 73b2ef784915..38c70b38b40a 100644 --- a/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/GuidedTourSettingResourceTest.java @@ -15,7 +15,7 @@ import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.user.UserUtilService; -class GuidedTourSettingResourceTest extends AbstractSpringIntegrationTest { +class GuidedTourSettingResourceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "gtsettingtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java index 6b542450301d..b66ee2697abe 100644 --- a/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/ImprintResourceIntegrationTest.java @@ -20,7 +20,7 @@ import de.tum.in.www1.artemis.domain.enumeration.Language; import net.minidev.json.JSONObject; -class ImprintResourceIntegrationTest extends AbstractSpringIntegrationTest { +class ImprintResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "ir"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java index 1bcde36694d4..0a324351bdd3 100644 --- a/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/LogResourceIntegrationTest.java @@ -10,7 +10,7 @@ import de.tum.in.www1.artemis.web.rest.vm.LoggerVM; -class LogResourceIntegrationTest extends AbstractSpringIntegrationTest { +class LogResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { @Test @WithMockUser(roles = "ADMIN") diff --git a/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java index b1e43c1b07b5..fcea52814b21 100644 --- a/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/LongFeedbackResourceIntegrationTest.java @@ -15,7 +15,7 @@ import de.tum.in.www1.artemis.participation.ParticipationUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class LongFeedbackResourceIntegrationTest extends AbstractSpringIntegrationTest { +class LongFeedbackResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "longfeedbackintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java index f4d7310d8eba..03c497955843 100644 --- a/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/Lti13LaunchIntegrationTest.java @@ -37,7 +37,7 @@ * see LTI message general details * see OpenId Connect launch flow */ -class Lti13LaunchIntegrationTest extends AbstractSpringIntegrationTest { +class Lti13LaunchIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final Key SIGNING_KEY = new SecretKeySpec("a".repeat(100).getBytes(), SignatureAlgorithm.HS256.getJcaName()); diff --git a/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java index 0bec8f90b646..9fa488862cd8 100644 --- a/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/OAuth2JWKSIntegrationTest.java @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.OnlineCourseConfigurationRepository; import de.tum.in.www1.artemis.security.OAuth2JWKSService; -class OAuth2JWKSIntegrationTest extends AbstractSpringIntegrationTest { +class OAuth2JWKSIntegrationTest extends AbstractSpringIntegrationIndependentTest { @Autowired private CourseRepository courseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java index ee5d98397599..4f9ac9e54a5d 100644 --- a/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/PrivacyStatementResourceIntegrationTest.java @@ -20,7 +20,7 @@ import de.tum.in.www1.artemis.domain.enumeration.Language; import net.minidev.json.JSONObject; -class PrivacyStatementResourceIntegrationTest extends AbstractSpringIntegrationTest { +class PrivacyStatementResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "psr"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java index 720b92913e78..185e049968f1 100644 --- a/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/StatisticsIntegrationTest.java @@ -46,7 +46,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseManagementStatisticsDTO; import de.tum.in.www1.artemis.web.rest.dto.ExerciseManagementStatisticsDTO; -class StatisticsIntegrationTest extends AbstractSpringIntegrationTest { +class StatisticsIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "statisticsintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java index 7d7aa211f80d..1e9595153988 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentComplaintIntegrationTest.java @@ -16,7 +16,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -40,7 +40,7 @@ import de.tum.in.www1.artemis.util.FileUtils; import de.tum.in.www1.artemis.web.rest.dto.SubmissionWithComplaintDTO; -class AssessmentComplaintIntegrationTest extends AbstractSpringIntegrationTest { +class AssessmentComplaintIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "assessmentcomplaintintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java index 67288a307d60..4a482f1c05ac 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/AssessmentTeamComplaintIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ComplaintType; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class AssessmentTeamComplaintIntegrationTest extends AbstractSpringIntegrationTest { +class AssessmentTeamComplaintIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "assmentteamcomplaint"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java index da12cb26a3f7..73ea06bc48b2 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ComplaintResponseIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.service.ParticipationService; import de.tum.in.www1.artemis.user.UserUtilService; -class ComplaintResponseIntegrationTest extends AbstractSpringIntegrationTest { +class ComplaintResponseIntegrationTest extends AbstractSpringIntegrationIndependentTest { private final Logger log = LoggerFactory.getLogger(ComplaintResponseIntegrationTest.class); diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java index 49641f50b732..406e25f51e81 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ExampleSubmissionIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.util.FileUtils; import de.tum.in.www1.artemis.web.rest.dto.TextAssessmentDTO; -class ExampleSubmissionIntegrationTest extends AbstractSpringIntegrationTest { +class ExampleSubmissionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private final Logger log = LoggerFactory.getLogger(ExampleSubmissionIntegrationTest.class); diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java index f94c1e83fc9e..2f03142618da 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.ExerciseScoresDTO; -class ExerciseScoresChartIntegrationTest extends AbstractSpringIntegrationTest { +class ExerciseScoresChartIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "exercisescoreschart"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java index 0dedd44eb7de..d3e45e4736a4 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/GradeStepIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.exam.Exam; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.web.rest.dto.GradeDTO; import de.tum.in.www1.artemis.web.rest.dto.GradeStepsDTO; -class GradeStepIntegrationTest extends AbstractSpringIntegrationTest { +class GradeStepIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "gradestep"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java index 5bd3a5805aa5..dc857b4506d2 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/GradingScaleIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.GradeStep; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.PageableSearchUtilService; -class GradingScaleIntegrationTest extends AbstractSpringIntegrationTest { +class GradingScaleIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "gradingscale"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java index 30624a11360c..6c200b0e88ef 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/RatingResourceIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.Language; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.service.RatingService; import de.tum.in.www1.artemis.user.UserUtilService; -class RatingResourceIntegrationTest extends AbstractSpringIntegrationTest { +class RatingResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "ratingresourceintegrationtest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java index d1ed8373a33c..7e31bbae4836 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorEffortIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.repository.UserRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TutorEffortIntegrationTest extends AbstractSpringIntegrationTest { +class TutorEffortIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "tutoreffort"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java index 6e1b17428b5a..c85e0eb84d29 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorLeaderboardServiceIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.TutorLeaderboardDTO; -class TutorLeaderboardServiceIntegrationTest extends AbstractSpringIntegrationTest { +class TutorLeaderboardServiceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "tlbsitest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java index 5e2bfc3b3f2e..a17159213d22 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class TutorParticipationIntegrationTest extends AbstractSpringIntegrationTest { +class TutorParticipationIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "tutorparticipationintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java index 2f6018f3c5a8..42384f7bd58c 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/TutorParticipationResourceIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ExampleSubmission; @@ -23,7 +23,7 @@ import de.tum.in.www1.artemis.repository.TutorParticipationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TutorParticipationResourceIntegrationTest extends AbstractSpringIntegrationTest { +class TutorParticipationResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "tutorparticipationresource"; diff --git a/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java index 81a886e6832a..f80bc1ea4342 100644 --- a/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/bonus/BonusIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.GradingScaleFactory; import de.tum.in.www1.artemis.assessment.GradingScaleUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.BonusExampleDTO; -class BonusIntegrationTest extends AbstractSpringIntegrationTest { +class BonusIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "bonusintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java b/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java index ade4c2ac4067..1d3c2672a013 100644 --- a/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java +++ b/src/test/java/de/tum/in/www1/artemis/config/TopicSubscriptionInterceptorTest.java @@ -12,14 +12,14 @@ import org.springframework.messaging.simp.stomp.StompCommand; import org.springframework.messaging.simp.stomp.StompHeaderAccessor; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.websocket.WebsocketConfiguration; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.exam.ExamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; @SuppressWarnings("unchecked") -class TopicSubscriptionInterceptorTest extends AbstractSpringIntegrationTest { +class TopicSubscriptionInterceptorTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "topicsubscriptioninterceptor"; diff --git a/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java b/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java index bdd09037bdb3..2e9c330c015c 100644 --- a/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java +++ b/src/test/java/de/tum/in/www1/artemis/domain/ExerciseTest.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseFactory; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.participation.ParticipationFactory; import de.tum.in.www1.artemis.service.ExerciseService; -class ExerciseTest extends AbstractSpringIntegrationTest { +class ExerciseTest extends AbstractSpringIntegrationIndependentTest { private Course course; diff --git a/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java b/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java index bc17ce46dd0f..bb98e07371f7 100644 --- a/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java +++ b/src/test/java/de/tum/in/www1/artemis/domain/ResultTest.java @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; import de.tum.in.www1.artemis.domain.enumeration.Visibility; import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.ResultRepository; import de.tum.in.www1.artemis.service.AssessmentService; -class ResultTest extends AbstractSpringIntegrationTest { +class ResultTest extends AbstractSpringIntegrationIndependentTest { Result result = new Result(); diff --git a/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java index ac007f95229c..f77f31d8bbf9 100644 --- a/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exam/ExamSessionIntegrationTest.java @@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.exam.Exam; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import inet.ipaddr.IPAddressString; -class ExamSessionIntegrationTest extends AbstractSpringIntegrationTest { +class ExamSessionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "examsessionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java index a9e4c772c14d..7931609ccc71 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/ExerciseIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -37,7 +37,7 @@ import de.tum.in.www1.artemis.web.rest.dto.StatsForDashboardDTO; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ExerciseIntegrationTest extends AbstractSpringIntegrationTest { +class ExerciseIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "exerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java index 11cfec33341a..a50184014df5 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadAssessmentIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.web.rest.dto.ResultDTO; @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -class FileUploadAssessmentIntegrationTest extends AbstractSpringIntegrationTest { +class FileUploadAssessmentIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "fileuploadassessment"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java index d4a7e56f2491..6f979cbc7d97 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadExerciseIntegrationTest.java @@ -16,7 +16,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.IncludedInOverallScore; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO; -class FileUploadExerciseIntegrationTest extends AbstractSpringIntegrationTest { +class FileUploadExerciseIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "fileuploaderxercise"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java index a1618f8d352e..c169d67f31c3 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/fileuploadexercise/FileUploadSubmissionIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.InitializationState; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class FileUploadSubmissionIntegrationTest extends AbstractSpringIntegrationTest { +class FileUploadSubmissionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "fileuploadsubmission"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java index 9835a35564d6..1f707aa15233 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/modelingexercise/ApollonDiagramResourceIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseFactory; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.CourseRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ApollonDiagramResourceIntegrationTest extends AbstractSpringIntegrationTest { +class ApollonDiagramResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "repositoryintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java index fd636f3bd8f1..a8953ef58b6f 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/GitServiceTest.java @@ -26,13 +26,13 @@ import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.File; import de.tum.in.www1.artemis.domain.FileType; import de.tum.in.www1.artemis.domain.Repository; import de.tum.in.www1.artemis.util.GitUtilService; -class GitServiceTest extends AbstractSpringIntegrationTest { +class GitServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private GitUtilService gitUtilService; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java index 42be71f0bd77..29e7fb51be26 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/PlantUmlIntegrationTest.java @@ -19,12 +19,12 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.user.UserUtilService; import net.sourceforge.plantuml.SourceStringReader; import net.sourceforge.plantuml.core.DiagramDescription; -class PlantUmlIntegrationTest extends AbstractSpringIntegrationTest { +class PlantUmlIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "plantumlintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java index cfd675e17024..3db8760bc506 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingAssessmentIntegrationTest.java @@ -19,7 +19,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; @@ -37,7 +37,7 @@ import de.tum.in.www1.artemis.util.FileUtils; import de.tum.in.www1.artemis.web.rest.dto.ResultDTO; -class ProgrammingAssessmentIntegrationTest extends AbstractSpringIntegrationTest { +class ProgrammingAssessmentIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "programmingassessment"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java index 2ce16a765a2a..334b336cd6ea 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGitIntegrationTest.java @@ -22,7 +22,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.VcsRepositoryUrl; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.web.rest.ProgrammingExerciseResourceEndpoints; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ProgrammingExerciseGitIntegrationTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseGitIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "progexgitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java index 1d2e23e1e8d0..0d91f8e94c74 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseParticipationIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.participation.*; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseParticipationIntegrationTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseParticipationIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "programmingexerciseparticipation"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java index 52c17bd9b335..780bf90380e5 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseRepositoryServiceTest.java @@ -8,13 +8,13 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.repository.ProgrammingExerciseRepository; import de.tum.in.www1.artemis.service.programming.ProgrammingExerciseRepositoryService; -class ProgrammingExerciseRepositoryServiceTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseRepositoryServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private ProgrammingExerciseRepository programmingExerciseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java index 39423e37f8fa..13223cc91777 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java @@ -1,14 +1,7 @@ package de.tum.in.www1.artemis.exercise.programmingexercise; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.inOrder; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.timeout; -import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.*; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java index c171e603325b..f24dc8ec5d00 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseServiceTest.java @@ -10,14 +10,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.repository.ProgrammingExerciseRepository; import de.tum.in.www1.artemis.repository.ProgrammingExerciseTestRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseServiceTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "progexservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java index 31387743ff2d..4dbd1b9914c5 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -40,7 +40,7 @@ import de.tum.in.www1.artemis.web.rest.dto.QuizBatchJoinDTO; import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO; -class QuizExerciseIntegrationTest extends AbstractSpringIntegrationTest { +class QuizExerciseIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "quizexerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java index 9e31aeb512f4..0f3822466f44 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.hestia.ProgrammingExerciseSolutionEntryRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class CodeHintIntegrationTest extends AbstractSpringIntegrationTest { +class CodeHintIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "codehint"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java index a13751ecde52..a3556cc65288 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/CodeHintServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; @SuppressWarnings("ArraysAsListWithZeroOrOneArgument") -class CodeHintServiceTest extends AbstractSpringIntegrationTest { +class CodeHintServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "codehintservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java index acfc631fd2c8..e05647ec8480 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseHintIntegrationTest extends AbstractSpringIntegrationTest { +class ExerciseHintIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "exercisehintintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java index a20150629798..5dc1c38c1deb 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ExerciseHintServiceTest.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; import de.tum.in.www1.artemis.domain.enumeration.FeedbackType; @@ -32,7 +32,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseHintServiceTest extends AbstractSpringIntegrationTest { +class ExerciseHintServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "exercisehintservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java index 405770041a1a..3bdcdad52da6 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/HestiaDatabaseTest.java @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -30,7 +30,7 @@ * This currently includes ProgrammingExerciseTask, ProgrammingExerciseSolutionEntry and CodeHint. * It tests if the addition and deletion of these models works as expected. */ -class HestiaDatabaseTest extends AbstractSpringIntegrationTest { +class HestiaDatabaseTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "hestiadatabase"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java index e3361b3b1688..b8a2864e6d76 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseSolutionEntryIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; import de.tum.in.www1.artemis.domain.hestia.CodeHint; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.hestia.ProgrammingExerciseTaskRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseSolutionEntryIntegrationTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseSolutionEntryIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "progexsolutionentry"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java index 927708dc0859..20b60d78d642 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.DomainObject; import de.tum.in.www1.artemis.domain.ProgrammingExercise; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseTaskIntegrationTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseTaskIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "progextask"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java index e47c485e77fd..6af86de04963 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/ProgrammingExerciseTaskServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.service.hestia.ProgrammingExerciseTaskService; import de.tum.in.www1.artemis.user.UserUtilService; -class ProgrammingExerciseTaskServiceTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseTaskServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "progextaskservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java index 23e8930250d2..2e0b2b5f61c7 100644 --- a/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/hestia/TestwiseCoverageIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.ProgrammingExerciseTestCase; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.RequestUtilService; -class TestwiseCoverageIntegrationTest extends AbstractSpringIntegrationTest { +class TestwiseCoverageIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "testwisecoverageint"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java index a8bb91c85899..a6f24a17fd88 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentResourceIntegrationTest.java @@ -14,14 +14,14 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class AttachmentResourceIntegrationTest extends AbstractSpringIntegrationTest { +class AttachmentResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "attachmentresourceintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java index 57b1e3ca3ed9..b4c95f36f5af 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitIntegrationTest.java @@ -28,7 +28,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Attachment; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.AttachmentUnit; @@ -38,7 +38,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class AttachmentUnitIntegrationTest extends AbstractSpringIntegrationTest { +class AttachmentUnitIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "attachmentunitintegrationtest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java index 9542bfd71685..16ee82a1dbe2 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/AttachmentUnitsIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.mock.web.MockMultipartFile; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.AttachmentUnit; import de.tum.in.www1.artemis.repository.AttachmentUnitRepository; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.web.rest.dto.LectureUnitInformationDTO; import de.tum.in.www1.artemis.web.rest.dto.LectureUnitSplitDTO; -class AttachmentUnitsIntegrationTest extends AbstractSpringIntegrationTest { +class AttachmentUnitsIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "attachmentunitsintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java index 5335c1c69e17..aab5f77c5bbd 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/ExerciseUnitIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.lecture.ExerciseUnit; @@ -21,7 +21,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseUnitIntegrationTest extends AbstractSpringIntegrationTest { +class ExerciseUnitIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "exerciseunitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java index 2bb270f10c63..54ac8d761e72 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/LectureIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.lecture.*; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.util.PageableSearchUtilService; -class LectureIntegrationTest extends AbstractSpringIntegrationTest { +class LectureIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "lectureintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java index 7ab1db0ce168..b1784948c5d5 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/LectureUnitIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.competency.CompetencyUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class LectureUnitIntegrationTest extends AbstractSpringIntegrationTest { +class LectureUnitIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "lectureunitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java index ec11e7a101de..a09199424c15 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/OnlineUnitIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.LectureUnit; import de.tum.in.www1.artemis.domain.lecture.OnlineUnit; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.OnlineResourceDTO; -class OnlineUnitIntegrationTest extends AbstractSpringIntegrationTest { +class OnlineUnitIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "onlineunitintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java index 10d537d46863..09715dba3702 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/TextUnitIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.LectureUnit; import de.tum.in.www1.artemis.domain.lecture.TextUnit; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.TextUnitRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TextUnitIntegrationTest extends AbstractSpringIntegrationTest { +class TextUnitIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "textunitintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java index 47f9cbac56b2..aea03a64a163 100644 --- a/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/lecture/VideoUnitIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Lecture; import de.tum.in.www1.artemis.domain.lecture.LectureUnit; import de.tum.in.www1.artemis.domain.lecture.VideoUnit; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.VideoUnitRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class VideoUnitIntegrationTest extends AbstractSpringIntegrationTest { +class VideoUnitIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "videounitintegrationtest"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java index 1d62133aeafc..e26368f0e914 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/AbstractConversationTest.java @@ -11,7 +11,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -35,7 +35,7 @@ /** * Contains useful methods for testing the conversations futures */ -abstract class AbstractConversationTest extends AbstractSpringIntegrationTest { +abstract class AbstractConversationTest extends AbstractSpringIntegrationIndependentTest { @Autowired CourseRepository courseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java index 283eefb2e64d..aefa041fef28 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/AnswerMessageIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.CourseInformationSharingConfiguration; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.dto.metis.PostDTO; -class AnswerMessageIntegrationTest extends AbstractSpringIntegrationTest { +class AnswerMessageIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "answermessageint"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java index 710859f22ddb..fc9a1ba726bc 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/AnswerPostIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.repository.metis.PostRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class AnswerPostIntegrationTest extends AbstractSpringIntegrationTest { +class AnswerPostIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "answerpostintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java index e32b98ea66a0..551fb0134afb 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/MessageIntegrationTest.java @@ -33,7 +33,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.CourseInformationSharingConfiguration; @@ -55,7 +55,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PostContextFilter; import de.tum.in.www1.artemis.web.websocket.dto.metis.PostDTO; -class MessageIntegrationTest extends AbstractSpringIntegrationTest { +class MessageIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "messageintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java index 06472d61d95c..1484c025dd32 100644 --- a/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/metis/ReactionIntegrationTest.java @@ -20,7 +20,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -35,7 +35,7 @@ import de.tum.in.www1.artemis.repository.metis.ReactionRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ReactionIntegrationTest extends AbstractSpringIntegrationTest { +class ReactionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "reactionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java b/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java index a996fe6e95c5..e54b9155663b 100644 --- a/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java +++ b/src/test/java/de/tum/in/www1/artemis/migration/MigrationIntegrityTest.java @@ -7,12 +7,12 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.migration.MigrationEntry; import de.tum.in.www1.artemis.config.migration.MigrationRegistry; import de.tum.in.www1.artemis.config.migration.MigrationService; -class MigrationIntegrityTest extends AbstractSpringIntegrationTest { +class MigrationIntegrityTest extends AbstractSpringIntegrationIndependentTest { @Autowired private MigrationRegistry migrationRegistry; diff --git a/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java index 1aa40436a24e..baeecfeea6c8 100644 --- a/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/migration/MigrationServiceTest.java @@ -20,7 +20,7 @@ import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Profiles; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.migration.MigrationEntry; import de.tum.in.www1.artemis.config.migration.MigrationIntegrityException; import de.tum.in.www1.artemis.config.migration.MigrationRegistry; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.migration.entries.TestChangeEntry20211216_231800; import de.tum.in.www1.artemis.repository.MigrationChangeRepository; -class MigrationServiceTest extends AbstractSpringIntegrationTest { +class MigrationServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private MigrationRegistry registry; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java index 15a2e10c5d1f..23c1f6f6e5ac 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java @@ -17,7 +17,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.QuizMode; @@ -34,7 +34,7 @@ import de.tum.in.www1.artemis.service.notifications.GroupNotificationScheduleService; import de.tum.in.www1.artemis.user.UserUtilService; -class GroupNotificationServiceTest extends AbstractSpringIntegrationTest { +class GroupNotificationServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "groupnotificationservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java index 7ed4c76aefad..a87bb48d8f96 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.NotificationSetting; import de.tum.in.www1.artemis.domain.User; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationResourceIntegrationTest extends AbstractSpringIntegrationTest { +class NotificationResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { @Autowired private CourseRepository courseRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java index be052bc3f2a1..781366b1c1ab 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsResourceIntegrationTest.java @@ -12,13 +12,13 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.NotificationSetting; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationSettingsResourceIntegrationTest extends AbstractSpringIntegrationTest { +class NotificationSettingsResourceIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "notificationsettingsresourrce"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java index 4d3d9e4af174..210025e43b83 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationSettingsServiceTest.java @@ -13,7 +13,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.NotificationSetting; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.enumeration.NotificationType; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.service.notifications.NotificationSettingsService; import de.tum.in.www1.artemis.user.UserUtilService; -class NotificationSettingsServiceTest extends AbstractSpringIntegrationTest { +class NotificationSettingsServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "notificationsettingsservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java index 228235ea652d..cc285c3a5a51 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/PushNotificationResourceTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceConfiguration; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceType; @@ -25,7 +25,7 @@ import de.tum.in.www1.artemis.web.rest.push_notification.PushNotificationUnregisterRequest; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -class PushNotificationResourceTest extends AbstractSpringIntegrationTest { +class PushNotificationResourceTest extends AbstractSpringIntegrationIndependentTest { @Autowired UserRepository userRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java index 1d09008ee82d..527781793ed0 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/SingleUserNotificationServiceTest.java @@ -29,7 +29,7 @@ import org.mockito.Captor; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -60,7 +60,7 @@ import de.tum.in.www1.artemis.service.notifications.SingleUserNotificationService; import de.tum.in.www1.artemis.user.UserUtilService; -class SingleUserNotificationServiceTest extends AbstractSpringIntegrationTest { +class SingleUserNotificationServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "singleusernotification"; diff --git a/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java index 59e4edeadd2d..caad0cffd0af 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/SystemNotificationIntegrationTest.java @@ -13,11 +13,11 @@ import org.springframework.security.test.context.support.WithAnonymousUser; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.notification.SystemNotification; import de.tum.in.www1.artemis.repository.SystemNotificationRepository; -class SystemNotificationIntegrationTest extends AbstractSpringIntegrationTest { +class SystemNotificationIntegrationTest extends AbstractSpringIntegrationIndependentTest { @Autowired private SystemNotificationRepository systemNotificationRepo; diff --git a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java index 563a56a79413..7fdbd64f88e2 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationSubmissionIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.repository.SubmissionRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ParticipationSubmissionIntegrationTest extends AbstractSpringIntegrationTest { +class ParticipationSubmissionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "psitest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java index e0d8b9d5ade6..aad7129eedef 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionExportIntegrationTest.java @@ -16,7 +16,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.Language; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.SubmissionExportOptionsDTO; -class SubmissionExportIntegrationTest extends AbstractSpringIntegrationTest { +class SubmissionExportIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "submissionexportintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java index bcdfedf84f12..b51e9e75d7e2 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/SubmissionIntegrationTest.java @@ -8,7 +8,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.util.PageableSearchUtilService; import de.tum.in.www1.artemis.web.rest.dto.PageableSearchDTO; -class SubmissionIntegrationTest extends AbstractSpringIntegrationTest { +class SubmissionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "submissionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java index 46d81fe9005b..c73610e57567 100644 --- a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCaseIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.exam.Exam; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PlagiarismCaseInfoDTO; import de.tum.in.www1.artemis.web.rest.dto.PlagiarismVerdictDTO; -class PlagiarismCaseIntegrationTest extends AbstractSpringIntegrationTest { +class PlagiarismCaseIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "plagiarismcaseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java index bb7a592669bb..55bf34dbf463 100644 --- a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismCheckIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.util.LinkedMultiValueMap; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextExercise; import de.tum.in.www1.artemis.domain.modeling.ModelingExercise; @@ -20,7 +20,7 @@ import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.util.FileUtils; -class PlagiarismCheckIntegrationTest extends AbstractSpringIntegrationTest { +class PlagiarismCheckIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "plagiarismcheck"; diff --git a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java index 569d76e306a7..6be418637f43 100644 --- a/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismIntegrationTest.java @@ -11,7 +11,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextExercise; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.PlagiarismComparisonStatusDTO; -class PlagiarismIntegrationTest extends AbstractSpringIntegrationTest { +class PlagiarismIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "plagiarismintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java b/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java index 0da3bb80fc37..5634ce479334 100644 --- a/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java +++ b/src/test/java/de/tum/in/www1/artemis/repository/StatisticsRepositoryTest.java @@ -15,7 +15,7 @@ import org.junit.jupiter.params.provider.EnumSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.PersistentAuditEvent; import de.tum.in.www1.artemis.domain.enumeration.GraphType; import de.tum.in.www1.artemis.domain.enumeration.SpanType; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class StatisticsRepositoryTest extends AbstractSpringIntegrationTest { +class StatisticsRepositoryTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "statisticsrepository"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java index ae29fa7212c4..822ee8487c62 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/AssessmentServiceTest.java @@ -15,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseFactory; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -36,7 +36,7 @@ import de.tum.in.www1.artemis.repository.ResultRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class AssessmentServiceTest extends AbstractSpringIntegrationTest { +class AssessmentServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "assessmentservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java index 0d4a4a3b742d..65831858ec52 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/BuildLogEntryServiceTest.java @@ -14,11 +14,11 @@ import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.BuildLogEntry; import de.tum.in.www1.artemis.domain.enumeration.ProgrammingLanguage; -class BuildLogEntryServiceTest extends AbstractSpringIntegrationTest { +class BuildLogEntryServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String GRADLE_SCENARIO = """ Build ABC23H01E01 - AB12345 - Default Job #5 (MY-JOB) started building on agent ls1Agent-test.artemistest.in.tum.de, bamboo version: 8.2.5 diff --git a/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java index cbb7a0dcb2e4..f14b3f369639 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ComplaintResponseServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.team.TeamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; -class ComplaintResponseServiceTest extends AbstractSpringIntegrationTest { +class ComplaintResponseServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "complaintresponseservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java index aa8c6109bd2e..9b7b549de9ba 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/CourseScoreCalculationServiceTest.java @@ -12,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.GradingScaleFactory; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -28,7 +28,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseScoresDTO; import de.tum.in.www1.artemis.web.rest.dto.StudentScoresDTO; -class CourseScoreCalculationServiceTest extends AbstractSpringIntegrationTest { +class CourseScoreCalculationServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "cscservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java index 4d6d3499bffe..0945cd521c5f 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/EmailSummaryServiceTest.java @@ -17,7 +17,7 @@ import org.mockito.ArgumentCaptor; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.DifficultyLevel; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.repository.NotificationSettingRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class EmailSummaryServiceTest extends AbstractSpringIntegrationTest { +class EmailSummaryServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "emailsummaryservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java index 37d1504a84ee..fc452f2ba014 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ExerciseDateServiceTest.java @@ -11,7 +11,7 @@ import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; import de.tum.in.www1.artemis.domain.exam.Exam; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class ExerciseDateServiceTest extends AbstractSpringIntegrationTest { +class ExerciseDateServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "exercisedateservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java index 74e2af4c6fae..1c2b035a781f 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ExerciseLifecycleServiceTest.java @@ -11,12 +11,12 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Exercise; import de.tum.in.www1.artemis.domain.TextExercise; import de.tum.in.www1.artemis.domain.enumeration.ExerciseLifecycle; -class ExerciseLifecycleServiceTest extends AbstractSpringIntegrationTest { +class ExerciseLifecycleServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private ExerciseLifecycleService exerciseLifecycleService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java index b474d8facf5e..4e07f0b2153a 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/FeatureToggleServiceTest.java @@ -9,11 +9,11 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.service.feature.Feature; import de.tum.in.www1.artemis.service.feature.FeatureToggleService; -class FeatureToggleServiceTest extends AbstractSpringIntegrationTest { +class FeatureToggleServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private FeatureToggleService featureToggleService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java index 9868c2d89c68..a9e48217c5e1 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/FeedbackServiceTest.java @@ -5,13 +5,13 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.Feedback; import de.tum.in.www1.artemis.domain.LongFeedbackText; import de.tum.in.www1.artemis.repository.FeedbackRepository; -class FeedbackServiceTest extends AbstractSpringIntegrationTest { +class FeedbackServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private FeedbackService feedbackService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java index f5d0e0e15873..df903482c30e 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/FileServiceTest.java @@ -24,10 +24,10 @@ import org.springframework.core.io.Resource; import org.springframework.util.ResourceUtils; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.exception.FilePathParsingException; -class FileServiceTest extends AbstractSpringIntegrationTest { +class FileServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private ResourceLoaderService resourceLoaderService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java index 950f1a986c9c..fb0aca636f3b 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/GradingScaleServiceTest.java @@ -15,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.GradingScaleUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class GradingScaleServiceTest extends AbstractSpringIntegrationTest { +class GradingScaleServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private GradingScaleService gradingScaleService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java index 2c50a71d3b59..264fa1646105 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/LectureImportServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Attachment; import de.tum.in.www1.artemis.domain.Course; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.LectureRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class LectureImportServiceTest extends AbstractSpringIntegrationTest { +class LectureImportServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "lectureimport"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java index 5f2c9a927762..b5fe10cefade 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/LectureServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.lecture.LectureFactory; import de.tum.in.www1.artemis.lecture.LectureUtilService; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.web.rest.dto.PageableSearchDTO; import de.tum.in.www1.artemis.web.rest.dto.SearchResultPageDTO; -class LectureServiceTest extends AbstractSpringIntegrationTest { +class LectureServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "lservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java index ff4cfad58d14..44009ed315dc 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ParticipationAuthorizationCheckServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.TextExercise; import de.tum.in.www1.artemis.domain.participation.ParticipationInterface; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.errors.AccessForbiddenException; -class ParticipationAuthorizationCheckServiceTest extends AbstractSpringIntegrationTest { +class ParticipationAuthorizationCheckServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "participationauthservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java index 9e3b718226c9..61d5b54735f5 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ParticipationLifecycleServiceTest.java @@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.enumeration.ParticipationLifecycle; @@ -23,7 +23,7 @@ import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.user.UserUtilService; -class ParticipationLifecycleServiceTest extends AbstractSpringIntegrationTest { +class ParticipationLifecycleServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "partlcservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java index fa715e8dc3ca..0bf22e90f7c3 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ParticipationTeamWebsocketServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.messaging.simp.stomp.StompHeaderAccessor; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.modeling.ModelingExercise; import de.tum.in.www1.artemis.domain.participation.Participation; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.team.ParticipationTeamWebsocketService; -class ParticipationTeamWebsocketServiceTest extends AbstractSpringIntegrationTest { +class ParticipationTeamWebsocketServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "participationteamwebsocket"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java index ab488d80aaa3..5cea54fee584 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/PresentationPointsCalculationServiceTest.java @@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.GradingScaleFactory; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; @@ -22,7 +22,7 @@ import de.tum.in.www1.artemis.repository.StudentParticipationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class PresentationPointsCalculationServiceTest extends AbstractSpringIntegrationTest { +class PresentationPointsCalculationServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "ppcservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java index 3b5c5dc2e58b..bbfc7d0d45e7 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ResourceLoaderServiceTest.java @@ -25,9 +25,9 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; -class ResourceLoaderServiceTest extends AbstractSpringIntegrationTest { +class ResourceLoaderServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private ResourceLoaderService resourceLoaderService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java index 2449a2748e4e..a595692b57b2 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ResultServiceTest.java @@ -12,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Feedback; import de.tum.in.www1.artemis.domain.ProgrammingExercise; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.repository.ProgrammingExerciseStudentParticipationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ResultServiceTest extends AbstractSpringIntegrationTest { +class ResultServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "resultservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java index accf65af1531..e2f74d8cbed4 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/SubmissionServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.assessment.ComplaintUtilService; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.web.rest.dto.SubmissionWithComplaintDTO; import de.tum.in.www1.artemis.web.rest.errors.AccessForbiddenException; -class SubmissionServiceTest extends AbstractSpringIntegrationTest { +class SubmissionServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "submissionservicetest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java index 39ecaace963a..9152aae542dd 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/TeamWebsocketServiceTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -27,7 +27,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.websocket.dto.TeamAssignmentPayload; -class TeamWebsocketServiceTest extends AbstractSpringIntegrationTest { +class TeamWebsocketServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "teamwebsocketservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java index 0cb3609598a7..ee2faa517e08 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/TitleCacheEvictionServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.CacheManager; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.ProgrammingExercise; import de.tum.in.www1.artemis.domain.enumeration.DiagramType; @@ -30,7 +30,7 @@ * The service is not directly injected / used here as it listens to Hibernate events, so we just apply * CRUD operations on the entities it supports. */ -class TitleCacheEvictionServiceTest extends AbstractSpringIntegrationTest { +class TitleCacheEvictionServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private CacheManager cacheManager; diff --git a/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java index 80a75e9a685a..3c80424663c4 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/UrlServiceTest.java @@ -8,14 +8,14 @@ import org.junit.jupiter.api.Test; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.VcsRepositoryUrl; import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; import de.tum.in.www1.artemis.domain.participation.SolutionProgrammingExerciseParticipation; import de.tum.in.www1.artemis.domain.participation.TemplateProgrammingExerciseParticipation; import de.tum.in.www1.artemis.exception.VersionControlException; -class UrlServiceTest extends AbstractSpringIntegrationTest { +class UrlServiceTest extends AbstractSpringIntegrationIndependentTest { private final VcsRepositoryUrl repositoryUrl1 = new VcsRepositoryUrl("https://ab12cde@bitbucket.ase.in.tum.de/scm/EIST2016RME/RMEXERCISE-ab12cde"); diff --git a/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java index 9e37c5cc6287..480c171f15c7 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/ZipFileServiceTest.java @@ -12,9 +12,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; -class ZipFileServiceTest extends AbstractSpringIntegrationTest { +class ZipFileServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private ZipFileService zipFileService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java index 810ad36485e0..7879349a1bb7 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamAccessServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -31,7 +31,7 @@ import de.tum.in.www1.artemis.web.rest.errors.ConflictException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ExamAccessServiceTest extends AbstractSpringIntegrationTest { +class ExamAccessServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "examaccessservicetest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java index 1dbd58c7fecc..4ebf28198f31 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.enumeration.InitializationState; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.user.UserUtilService; -class ExamQuizServiceTest extends AbstractSpringIntegrationTest { +class ExamQuizServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "eqservicetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java index d54d161771c6..0b067e1267b9 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamServiceTest.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.TextExercise; @@ -29,7 +29,7 @@ import de.tum.in.www1.artemis.web.rest.dto.ExamChecklistDTO; import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; -class ExamServiceTest extends AbstractSpringIntegrationTest { +class ExamServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private ExamService examService; diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java index eee471c09860..f2217fb1b452 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/ExamSubmissionServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; @@ -32,7 +32,7 @@ import de.tum.in.www1.artemis.web.rest.errors.AccessForbiddenException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class ExamSubmissionServiceTest extends AbstractSpringIntegrationTest { +class ExamSubmissionServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "esstest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java index 030e40c5c4b9..27de96ba7b44 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/exam/StudentExamAccessServiceTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.User; @@ -24,7 +24,7 @@ import de.tum.in.www1.artemis.web.rest.errors.ConflictException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class StudentExamAccessServiceTest extends AbstractSpringIntegrationTest { +class StudentExamAccessServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "seastest"; // only lower case is supported diff --git a/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java index bb22960b55fc..3af87124c965 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/notifications/ConversationNotificationServiceTest.java @@ -15,7 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.DomainObject; @@ -33,7 +33,7 @@ import de.tum.in.www1.artemis.repository.metis.conversation.ConversationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class ConversationNotificationServiceTest extends AbstractSpringIntegrationTest { +class ConversationNotificationServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "conversationnotificationservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java index b6579e5e9fa9..a6dd74b3baca 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/notifications/TutorialGroupNotificationServiceTest.java @@ -21,7 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.Language; @@ -38,7 +38,7 @@ import de.tum.in.www1.artemis.repository.tutorialgroups.TutorialGroupRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class TutorialGroupNotificationServiceTest extends AbstractSpringIntegrationTest { +class TutorialGroupNotificationServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "tutorialgroupnotifservice"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java index ac1331f509b7..460fd2662a6f 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseFeedbackCreationServiceTest.java @@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.Feedback; import de.tum.in.www1.artemis.domain.enumeration.ProgrammingLanguage; @@ -18,7 +18,7 @@ import de.tum.in.www1.artemis.exercise.programmingexercise.ProgrammingExerciseFactory; import de.tum.in.www1.artemis.service.dto.StaticCodeAnalysisReportDTO; -class ProgrammingExerciseFeedbackCreationServiceTest extends AbstractSpringIntegrationTest { +class ProgrammingExerciseFeedbackCreationServiceTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "progexfeedbackcreaiontest"; diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java index 2afad4706124..70f760a28185 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/PushNotificationDeviceConfigurationCleanupServiceTest.java @@ -10,14 +10,14 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.domain.User; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceConfiguration; import de.tum.in.www1.artemis.domain.push_notification.PushNotificationDeviceType; import de.tum.in.www1.artemis.repository.PushNotificationDeviceConfigurationRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class PushNotificationDeviceConfigurationCleanupServiceTest extends AbstractSpringIntegrationTest { +class PushNotificationDeviceConfigurationCleanupServiceTest extends AbstractSpringIntegrationIndependentTest { @Autowired private PushNotificationDeviceConfigurationRepository deviceConfigurationRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index 0873ae6535c1..98edf4152d64 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -17,7 +17,7 @@ import com.hazelcast.core.HazelcastInstance; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Result; @@ -32,7 +32,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; @Isolated -class QuizCacheTest extends AbstractSpringIntegrationTest { +class QuizCacheTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "quizcachetest"; diff --git a/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java index 4971aa6283c3..2efa091f3fc5 100644 --- a/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/team/TeamImportIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -23,7 +23,7 @@ import de.tum.in.www1.artemis.repository.*; import de.tum.in.www1.artemis.user.UserUtilService; -class TeamImportIntegrationTest extends AbstractSpringIntegrationTest { +class TeamImportIntegrationTest extends AbstractSpringIntegrationIndependentTest { @Autowired private CourseRepository courseRepo; diff --git a/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java index ddd20d2313d6..b692c72f7f97 100644 --- a/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/team/TeamIntegrationTest.java @@ -13,7 +13,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.ExerciseMode; @@ -30,7 +30,7 @@ import de.tum.in.www1.artemis.user.UserUtilService; import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; -class TeamIntegrationTest extends AbstractSpringIntegrationTest { +class TeamIntegrationTest extends AbstractSpringIntegrationIndependentTest { @Autowired private CourseRepository courseRepo; diff --git a/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java index f50cf94d7575..febe53d52064 100644 --- a/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/text/AssessmentEventIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Exercise; @@ -26,7 +26,7 @@ import de.tum.in.www1.artemis.repository.UserRepository; import de.tum.in.www1.artemis.user.UserUtilService; -class AssessmentEventIntegrationTest extends AbstractSpringIntegrationTest { +class AssessmentEventIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "assessmentevent"; diff --git a/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java index 1a84ff09c62b..f7db1a2b9e44 100644 --- a/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/text/TextExerciseIntegrationTest.java @@ -19,7 +19,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.course.CourseUtilService; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.*; @@ -48,7 +48,7 @@ import de.tum.in.www1.artemis.web.rest.dto.CourseForDashboardDTO; import de.tum.in.www1.artemis.web.rest.dto.PlagiarismComparisonStatusDTO; -class TextExerciseIntegrationTest extends AbstractSpringIntegrationTest { +class TextExerciseIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "textexerciseintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java index d1b2a770d9c5..214c1028a87c 100644 --- a/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/text/TextSubmissionIntegrationTest.java @@ -15,7 +15,7 @@ import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; import de.tum.in.www1.artemis.config.Constants; import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.domain.enumeration.AssessmentType; @@ -41,7 +41,7 @@ import de.tum.in.www1.artemis.web.rest.errors.BadRequestAlertException; import de.tum.in.www1.artemis.web.rest.errors.EntityNotFoundException; -class TextSubmissionIntegrationTest extends AbstractSpringIntegrationTest { +class TextSubmissionIntegrationTest extends AbstractSpringIntegrationIndependentTest { private static final String TEST_PREFIX = "textsubmissionintegration"; diff --git a/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java index 0d901dbde489..a761d27aeff1 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java +++ b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java @@ -127,7 +127,7 @@ private enum TestGroup { BAMBOO_INTEGRATION_TEST(AbstractSpringIntegrationBambooBitbucketJiraTest.class), GITLAB_INTEGRATION_TEST(AbstractSpringIntegrationGitlabCIGitlabSamlTest.class), JENKINS_INTEGRATION_TEST(AbstractSpringIntegrationJenkinsGitlabTest.class), LOCAL_INTEGRATION_TEST(AbstractSpringIntegrationLocalCILocalVCTest.class), - MIN_INTEGRATION_TEST(AbstractSpringIntegrationTest.class); + MIN_INTEGRATION_TEST(AbstractSpringIntegrationIndependentTest.class); @NotNull private final Class clazz; diff --git a/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java b/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java index 3851fa1fd04d..6762f1ab3503 100644 --- a/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/web/rest/AndroidAppSiteAssociationResourceTest.java @@ -7,9 +7,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; -class AndroidAppSiteAssociationResourceTest extends AbstractSpringIntegrationTest { +class AndroidAppSiteAssociationResourceTest extends AbstractSpringIntegrationIndependentTest { @Autowired AndroidAppSiteAssociationResource androidAppSiteAssociationResource; diff --git a/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java b/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java index cc3f11b35d9c..fc89211686d4 100644 --- a/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/web/rest/AppleAppSiteAssociationResourceTest.java @@ -5,9 +5,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import de.tum.in.www1.artemis.AbstractSpringIntegrationTest; +import de.tum.in.www1.artemis.AbstractSpringIntegrationIndependentTest; -class AppleAppSiteAssociationResourceTest extends AbstractSpringIntegrationTest { +class AppleAppSiteAssociationResourceTest extends AbstractSpringIntegrationIndependentTest { @Autowired AppleAppSiteAssociationResource appleAppSiteAssociationResource; From ed16b3726dba14f9c643df9888699e12371afae4 Mon Sep 17 00:00:00 2001 From: lara Date: Tue, 19 Sep 2023 15:44:21 +0200 Subject: [PATCH 52/60] add await to ParticipantScoreIntegrationTest and ExerciseScoresChartIntegrationTest --- .../assessment/ExerciseScoresChartIntegrationTest.java | 5 ++++- .../artemis/assessment/ParticipantScoreIntegrationTest.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java index 2f03142618da..b9c1839d4d05 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ExerciseScoresChartIntegrationTest.java @@ -19,7 +19,9 @@ import de.tum.in.www1.artemis.domain.*; import de.tum.in.www1.artemis.exercise.textexercise.TextExerciseUtilService; import de.tum.in.www1.artemis.participation.ParticipationUtilService; -import de.tum.in.www1.artemis.repository.*; +import de.tum.in.www1.artemis.repository.ParticipantScoreRepository; +import de.tum.in.www1.artemis.repository.TeamRepository; +import de.tum.in.www1.artemis.repository.UserRepository; import de.tum.in.www1.artemis.service.scheduled.ParticipantScoreScheduleService; import de.tum.in.www1.artemis.team.TeamUtilService; import de.tum.in.www1.artemis.user.UserUtilService; @@ -111,6 +113,7 @@ void setupTestScenario() { participationUtilService.createParticipationSubmissionAndResult(idOfTeamTextExercise, team2, 10.0, 10.0, 90, true); participantScoreScheduleService.executeScheduledTasks(); + await().until(participantScoreScheduleService::isIdle); await().until(() -> participantScoreRepository.findAllByExercise(textExercise).size() == 3); await().until(() -> participantScoreRepository.findAllByExercise(teamExercise).size() == 2); } diff --git a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java index ad9c31819001..86bb975e28b9 100644 --- a/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/assessment/ParticipantScoreIntegrationTest.java @@ -137,6 +137,8 @@ void setupTestScenario() { long getIdOfIndividualTextExerciseOfExam = examTextExercise.getId(); participationUtilService.createParticipationSubmissionAndResult(getIdOfIndividualTextExerciseOfExam, student1, 10.0, 10.0, 50, true); + participantScoreScheduleService.executeScheduledTasks(); + await().until(participantScoreScheduleService::isIdle); await().until(() -> participantScoreRepository.findAllByExercise(textExercise).size() == 1); await().until(() -> participantScoreRepository.findAllByExercise(teamExercise).size() == 1); await().until(() -> participantScoreRepository.findAllByExercise(examTextExercise).size() == 1); From acb3057fd36c9939b9289ea8c181284783040068 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Tue, 19 Sep 2023 18:40:44 +0200 Subject: [PATCH 53/60] Isolated getParticipation_quizExerciseStartedAndSubmissionAllowed --- .../ParticipationIntegrationTest.java | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java index d650e92d4517..4b8faf9363eb 100644 --- a/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/participation/ParticipationIntegrationTest.java @@ -8,9 +8,8 @@ import java.util.*; import java.util.stream.IntStream; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.*; +import org.junit.jupiter.api.parallel.Isolated; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.EnumSource; @@ -1231,23 +1230,6 @@ void getParticipation_quizExerciseStartedAndNoParticipation(QuizMode quizMode) t request.getNullable("/api/exercises/" + quizEx.getId() + "/participation", HttpStatus.NO_CONTENT, StudentParticipation.class); } - @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") - @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") - @EnumSource(QuizMode.class) - void getParticipation_quizExerciseStartedAndSubmissionAllowed(QuizMode quizMode) throws Exception { - var quizEx = QuizExerciseFactory.generateQuizExercise(ZonedDateTime.now().minusMinutes(1), ZonedDateTime.now().plusMinutes(5), quizMode, course).duration(360); - quizEx = exerciseRepo.save(quizEx); - - if (quizMode != QuizMode.SYNCHRONIZED) { - var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizEx, ZonedDateTime.now().minusSeconds(10))); - quizExerciseUtilService.joinQuizBatch(quizEx, batch, TEST_PREFIX + "student1"); - } - var participation = request.get("/api/exercises/" + quizEx.getId() + "/participation", HttpStatus.OK, StudentParticipation.class); - assertThat(participation.getExercise()).as("Participation contains exercise").isEqualTo(quizEx); - assertThat(participation.getResults()).as("New result was added to the participation").hasSize(1); - assertThat(participation.getInitializationState()).as("Participation was initialized").isEqualTo(InitializationState.INITIALIZED); - } - @Test @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") void getParticipation_quizBatchNotPresent() throws Exception { @@ -1329,4 +1311,26 @@ void testCheckQuizParticipation(QuizMode quizMode) throws Exception { assertThat(actualSubmittedAnswerText.getText()).isEqualTo("test"); assertThat(actualSubmittedAnswerText.isIsCorrect()).isFalse(); } + + @Nested + @Isolated + class ParticipationIntegrationIsolatedTest { + + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + @EnumSource(QuizMode.class) + void getParticipation_quizExerciseStartedAndSubmissionAllowed(QuizMode quizMode) throws Exception { + var quizEx = QuizExerciseFactory.generateQuizExercise(ZonedDateTime.now().minusMinutes(1), ZonedDateTime.now().plusMinutes(5), quizMode, course).duration(360); + quizEx = exerciseRepo.save(quizEx); + + if (quizMode != QuizMode.SYNCHRONIZED) { + var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizEx, ZonedDateTime.now().minusSeconds(10))); + quizExerciseUtilService.joinQuizBatch(quizEx, batch, TEST_PREFIX + "student1"); + } + var participation = request.get("/api/exercises/" + quizEx.getId() + "/participation", HttpStatus.OK, StudentParticipation.class); + assertThat(participation.getExercise()).as("Participation contains exercise").isEqualTo(quizEx); + assertThat(participation.getResults()).as("New result was added to the participation").hasSize(1); + assertThat(participation.getInitializationState()).as("Participation was initialized").isEqualTo(InitializationState.INITIALIZED); + } + } } From 89259bf357fbe964776ed9c557c38af189bfc190 Mon Sep 17 00:00:00 2001 From: lara Date: Tue, 19 Sep 2023 20:57:26 +0200 Subject: [PATCH 54/60] add quiz cache tests --- .../scheduled/cache/quiz/QuizCacheTest.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index 98edf4152d64..2a225d6f3960 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -1,15 +1,19 @@ package de.tum.in.www1.artemis.service.scheduled.cache.quiz; import static de.tum.in.www1.artemis.service.scheduled.cache.quiz.QuizCache.HAZELCAST_CACHED_EXERCISE_UPDATE_TOPIC; +import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; +import java.security.Principal; import java.time.ZonedDateTime; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Isolated; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; import org.junit.jupiter.params.provider.EnumSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -26,10 +30,13 @@ import de.tum.in.www1.artemis.domain.quiz.QuizSubmission; import de.tum.in.www1.artemis.exercise.quizexercise.QuizExerciseFactory; import de.tum.in.www1.artemis.exercise.quizexercise.QuizExerciseUtilService; +import de.tum.in.www1.artemis.participation.ParticipationUtilService; import de.tum.in.www1.artemis.repository.QuizExerciseRepository; +import de.tum.in.www1.artemis.repository.QuizSubmissionRepository; import de.tum.in.www1.artemis.service.QuizBatchService; import de.tum.in.www1.artemis.service.QuizExerciseService; import de.tum.in.www1.artemis.user.UserUtilService; +import de.tum.in.www1.artemis.web.websocket.QuizSubmissionWebsocketService; @Isolated class QuizCacheTest extends AbstractSpringIntegrationIndependentTest { @@ -57,6 +64,15 @@ class QuizCacheTest extends AbstractSpringIntegrationIndependentTest { @Autowired private QuizExerciseRepository quizExerciseRepository; + @Autowired + QuizSubmissionWebsocketService quizSubmissionWebsocketService; + + @Autowired + QuizSubmissionRepository submissionRepository; + + @Autowired + ParticipationUtilService participationUtilService; + @BeforeEach void init() { // do not use the schedule service based on a time interval in the tests, because this would result in flaky tests that run much slower @@ -99,4 +115,64 @@ void testQuizSubmitNoDatabaseRequests(QuizMode quizMode) throws Exception { assertThatDb(() -> request.postWithResponseBody("/api/exercises/" + exerciseId + "/submissions/live", quizSubmission, Result.class, HttpStatus.OK)) .hasBeenCalledTimes(quizMode == QuizMode.SYNCHRONIZED ? 0 : 1); } + + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + @CsvSource({ "true,true", "true,false", "false,true", "false,false" }) + void testProcessSubmission(boolean submitted, boolean deleted) { + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(1), null, QuizMode.SYNCHRONIZED); + quizExercise.duration(240); + quizExerciseRepository.save(quizExercise); + + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, submitted, null); + String username = TEST_PREFIX + "student1"; + Principal principal = () -> username; + + quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); + if (deleted) { + quizExerciseRepository.delete(quizExercise); + } + quizScheduleService.processCachedQuizSubmissions(); + assertThat(submissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).hasSize(submitted && !deleted ? 1 : 0); + } + + @ParameterizedTest(name = "{displayName} [{index}] {argumentsWithNames}") + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + @CsvSource({ "true,true", "true,false", "false,true", "false,false" }) + void testQuizBatchEnded(boolean quizEnded, boolean batchEnded) { + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(2), quizEnded ? ZonedDateTime.now().minusMinutes(1) : null, + QuizMode.BATCHED); + quizExercise.duration(batchEnded ? 5 : 3600); + quizExerciseRepository.save(quizExercise); + + var batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusMinutes(1))); + quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student1"); + + quizScheduleService.processCachedQuizSubmissions(); + + assertThat(submissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).hasSize(batchEnded ? 1 : 0); + } + + @Test + @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") + void testQuizEnded() { + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(1), null, QuizMode.SYNCHRONIZED); + quizExercise.duration(5); + quizExerciseRepository.save(quizExercise); + + QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, null); + String username = TEST_PREFIX + "student1"; + Principal principal = () -> username; + + quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); + + quizExercise.setDueDate(ZonedDateTime.now().minusMinutes(1)); + quizExerciseService.save(quizExercise); + + quizScheduleService.processCachedQuizSubmissions(); + // verify(websocketMessagingService, timeout(3000)).sendMessageToUser(any(), any(), any()); + // todo: hasNewSubmissions, hasNewParticipations, hasNewResults + + // assertThat(submissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).hasSize(submitted? 1 : 0); + } } From 68c11882900ab3150d6f517a2d1c93b07637bb28 Mon Sep 17 00:00:00 2001 From: lara Date: Wed, 20 Sep 2023 12:02:53 +0200 Subject: [PATCH 55/60] fix shouldRecalculateScoreWithTestCaseBonusAndExerciseBonus --- ...ProgrammingExerciseGradingServiceTest.java | 10 +++++--- .../scheduled/cache/quiz/QuizCacheTest.java | 25 ++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGradingServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGradingServiceTest.java index 88dc5b760cc3..75b5a615da1c 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGradingServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseGradingServiceTest.java @@ -3,6 +3,8 @@ import static de.tum.in.www1.artemis.config.Constants.TEST_CASES_DUPLICATE_NOTIFICATION; import static de.tum.in.www1.artemis.web.rest.ProgrammingExerciseResourceEndpoints.ROOT; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.verify; import java.time.ZonedDateTime; @@ -10,6 +12,8 @@ import java.util.function.Function; import java.util.stream.Collectors; +import javax.mail.internet.MimeMessage; + import org.assertj.core.data.Offset; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -30,10 +34,7 @@ import de.tum.in.www1.artemis.domain.enumeration.Visibility; import de.tum.in.www1.artemis.domain.exam.Exam; import de.tum.in.www1.artemis.domain.exam.ExerciseGroup; -import de.tum.in.www1.artemis.domain.participation.Participation; -import de.tum.in.www1.artemis.domain.participation.ProgrammingExerciseStudentParticipation; -import de.tum.in.www1.artemis.domain.participation.SolutionProgrammingExerciseParticipation; -import de.tum.in.www1.artemis.domain.participation.StudentParticipation; +import de.tum.in.www1.artemis.domain.participation.*; import de.tum.in.www1.artemis.exam.ExamUtilService; import de.tum.in.www1.artemis.exercise.ExerciseUtilService; import de.tum.in.www1.artemis.participation.ParticipationUtilService; @@ -257,6 +258,7 @@ void shouldAddFeedbackForDuplicateTestCases() { assertThat(result.getFeedbacks()).hasSize(countOfNewFeedbacks); String notificationText = TEST_CASES_DUPLICATE_NOTIFICATION + "test3, test1"; verify(groupNotificationService).notifyEditorAndInstructorGroupAboutDuplicateTestCasesForExercise(programmingExercise, notificationText); + verify(javaMailSender, timeout(4000)).send(any(MimeMessage.class)); } @Test diff --git a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java index 2a225d6f3960..4789b09607f9 100644 --- a/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java +++ b/src/test/java/de/tum/in/www1/artemis/service/scheduled/cache/quiz/QuizCacheTest.java @@ -3,6 +3,9 @@ import static de.tum.in.www1.artemis.service.scheduled.cache.quiz.QuizCache.HAZELCAST_CACHED_EXERCISE_UPDATE_TOPIC; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; import java.security.Principal; import java.time.ZonedDateTime; @@ -26,6 +29,7 @@ import de.tum.in.www1.artemis.domain.Course; import de.tum.in.www1.artemis.domain.Result; import de.tum.in.www1.artemis.domain.enumeration.QuizMode; +import de.tum.in.www1.artemis.domain.quiz.QuizBatch; import de.tum.in.www1.artemis.domain.quiz.QuizExercise; import de.tum.in.www1.artemis.domain.quiz.QuizSubmission; import de.tum.in.www1.artemis.exercise.quizexercise.QuizExerciseFactory; @@ -155,24 +159,15 @@ void testQuizBatchEnded(boolean quizEnded, boolean batchEnded) { @Test @WithMockUser(username = TEST_PREFIX + "student1", roles = "USER") - void testQuizEnded() { - QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(1), null, QuizMode.SYNCHRONIZED); + void testQuizNewParticipationAndStatistics() { + QuizExercise quizExercise = quizExerciseUtilService.createQuiz(ZonedDateTime.now().minusMinutes(2), ZonedDateTime.now().minusMinutes(1), QuizMode.SYNCHRONIZED); quizExercise.duration(5); - quizExerciseRepository.save(quizExercise); - - QuizSubmission quizSubmission = QuizExerciseFactory.generateSubmissionForThreeQuestions(quizExercise, 1, true, null); - String username = TEST_PREFIX + "student1"; - Principal principal = () -> username; - - quizSubmissionWebsocketService.saveSubmission(quizExercise.getId(), quizSubmission, principal); - - quizExercise.setDueDate(ZonedDateTime.now().minusMinutes(1)); quizExerciseService.save(quizExercise); - quizScheduleService.processCachedQuizSubmissions(); - // verify(websocketMessagingService, timeout(3000)).sendMessageToUser(any(), any(), any()); - // todo: hasNewSubmissions, hasNewParticipations, hasNewResults + QuizBatch batch = quizBatchService.save(QuizExerciseFactory.generateQuizBatch(quizExercise, ZonedDateTime.now().minusMinutes(1))); + quizExerciseUtilService.joinQuizBatch(quizExercise, batch, TEST_PREFIX + "student1"); - // assertThat(submissionRepository.findByParticipation_Exercise_Id(quizExercise.getId())).hasSize(submitted? 1 : 0); + quizScheduleService.processCachedQuizSubmissions(); + verify(websocketMessagingService, timeout(3000)).sendMessageToUser(any(), any(), any()); } } From 8fdfc5aba3d1dbfb17ed838fbe0f340c9ab3cbea Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:55:39 +0200 Subject: [PATCH 56/60] improve IrisMessageIntegrationTest > sendOneMessage --- .../iris/AbstractIrisIntegrationTest.java | 17 +++++------------ .../iris/IrisMessageIntegrationTest.java | 6 +----- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/iris/AbstractIrisIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/iris/AbstractIrisIntegrationTest.java index d6893a13f9f8..f2ccfa6cdfab 100644 --- a/src/test/java/de/tum/in/www1/artemis/iris/AbstractIrisIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/iris/AbstractIrisIntegrationTest.java @@ -55,6 +55,8 @@ public abstract class AbstractIrisIntegrationTest extends AbstractSpringIntegrat @Autowired protected ProgrammingExerciseUtilService programmingExerciseUtilService; + private static final long TIMEOUT_MS = 200; + @BeforeEach void setup() { irisRequestMockProvider.enableMockingOfRequests(); @@ -99,15 +101,6 @@ protected IrisTemplate createDummyTemplate() { return template; } - /** - * Wait for the iris message to be processed by Iris, the LLM mock and the websocket service. - * - * @throws InterruptedException if the thread is interrupted - */ - protected void waitForIrisMessageToBeProcessed() throws InterruptedException { - Thread.sleep(100); - } - /** * Verify that the message was sent through the websocket. * @@ -116,7 +109,7 @@ protected void waitForIrisMessageToBeProcessed() throws InterruptedException { * @param message the content of the message */ protected void verifyMessageWasSentOverWebsocket(String user, Long sessionId, String message) { - verify(websocketMessagingService, times(1)).sendMessageToUser(eq(user), eq("/topic/iris/sessions/" + sessionId), + verify(websocketMessagingService, timeout(TIMEOUT_MS).times(1)).sendMessageToUser(eq(user), eq("/topic/iris/sessions/" + sessionId), ArgumentMatchers.argThat(object -> object instanceof IrisWebsocketService.IrisWebsocketDTO websocketDTO && websocketDTO.getType() == IrisWebsocketService.IrisWebsocketDTO.IrisWebsocketMessageType.MESSAGE && Objects.equals(websocketDTO.getMessage().getContent().stream().map(IrisMessageContent::getTextContent).collect(Collectors.joining("\n")), message))); @@ -130,7 +123,7 @@ protected void verifyMessageWasSentOverWebsocket(String user, Long sessionId, St * @param message the message */ protected void verifyMessageWasSentOverWebsocket(String user, Long sessionId, IrisMessage message) { - verify(websocketMessagingService, times(1)).sendMessageToUser(eq(user), eq("/topic/iris/sessions/" + sessionId), + verify(websocketMessagingService, timeout(TIMEOUT_MS).times(1)).sendMessageToUser(eq(user), eq("/topic/iris/sessions/" + sessionId), ArgumentMatchers.argThat(object -> object instanceof IrisWebsocketService.IrisWebsocketDTO websocketDTO && websocketDTO.getType() == IrisWebsocketService.IrisWebsocketDTO.IrisWebsocketMessageType.MESSAGE && Objects.equals(websocketDTO.getMessage().getContent().stream().map(IrisMessageContent::getTextContent).toList(), @@ -144,7 +137,7 @@ protected void verifyMessageWasSentOverWebsocket(String user, Long sessionId, Ir * @param sessionId the session id */ protected void verifyErrorWasSentOverWebsocket(String user, Long sessionId) { - verify(websocketMessagingService, times(1)).sendMessageToUser(eq(user), eq("/topic/iris/sessions/" + sessionId), + verify(websocketMessagingService, timeout(TIMEOUT_MS).times(1)).sendMessageToUser(eq(user), eq("/topic/iris/sessions/" + sessionId), ArgumentMatchers.argThat(object -> object instanceof IrisWebsocketService.IrisWebsocketDTO websocketDTO && websocketDTO.getType() == IrisWebsocketService.IrisWebsocketDTO.IrisWebsocketMessageType.ERROR)); } diff --git a/src/test/java/de/tum/in/www1/artemis/iris/IrisMessageIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/iris/IrisMessageIntegrationTest.java index b4a72b067632..489f56518344 100644 --- a/src/test/java/de/tum/in/www1/artemis/iris/IrisMessageIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/iris/IrisMessageIntegrationTest.java @@ -81,9 +81,7 @@ void sendOneMessage() throws Exception { // Compare contents of messages by only comparing the textContent field assertThat(irisMessage.getContent()).hasSize(3).map(IrisMessageContent::getTextContent) .isEqualTo(messageToSend.getContent().stream().map(IrisMessageContent::getTextContent).toList()); - var irisSessionFromDb = irisSessionRepository.findByIdWithMessagesElseThrow(irisSession.getId()); - assertThat(irisSessionFromDb.getMessages()).hasSize(1).isEqualTo(List.of(irisMessage)); - await().until(() -> irisSessionRepository.findByIdWithMessagesElseThrow(irisSession.getId()).getMessages().size() == 2); + await().untilAsserted(() -> assertThat(irisSessionRepository.findByIdWithMessagesElseThrow(irisSession.getId()).getMessages()).hasSize(2).contains(irisMessage)); verifyMessageWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId(), messageToSend); verifyMessageWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId(), "Hello World"); @@ -246,7 +244,6 @@ void sendOneMessageBadRequest() throws Exception { request.postWithResponseBody("/api/iris/sessions/" + irisSession.getId() + "/messages", messageToSend, IrisMessage.class, HttpStatus.CREATED); - waitForIrisMessageToBeProcessed(); verifyMessageWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId(), messageToSend); verifyErrorWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId()); verifyNothingElseWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId()); @@ -266,7 +263,6 @@ void sendOneMessageEmptyBody() throws Exception { request.postWithResponseBody("/api/iris/sessions/" + irisSession.getId() + "/messages", messageToSend, IrisMessage.class, HttpStatus.CREATED); - waitForIrisMessageToBeProcessed(); verifyMessageWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId(), messageToSend); verifyErrorWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId()); verifyNothingElseWasSentOverWebsocket(TEST_PREFIX + "student1", irisSession.getId()); From da44406f72694209a0890d68ce34e0f336d7451a Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:36:19 +0200 Subject: [PATCH 57/60] Fix fixable Teamscale issues --- .../quizexercise/QuizExerciseUtilService.java | 4 -- .../ParallelConsoleAppender.java | 60 ++++++++++--------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java index 2b78e0470607..7d8efd6bf47b 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/quizexercise/QuizExerciseUtilService.java @@ -31,7 +31,6 @@ import de.tum.in.www1.artemis.service.FilePathService; import de.tum.in.www1.artemis.service.scheduled.cache.quiz.QuizScheduleService; import de.tum.in.www1.artemis.user.UserUtilService; -import de.tum.in.www1.artemis.util.RequestUtilService; /** * Service responsible for initializing the database with specific testdata related to quiz exercises for use in integration tests. @@ -72,9 +71,6 @@ public class QuizExerciseUtilService { @Autowired private CourseUtilService courseUtilService; - @Autowired - private RequestUtilService requestUtilService; - @Autowired private SubmittedAnswerRepository submittedAnswerRepository; diff --git a/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java index a761d27aeff1..c22c66e90dff 100644 --- a/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java +++ b/src/test/java/de/tum/in/www1/artemis/util/junit_parallel_logging/ParallelConsoleAppender.java @@ -3,17 +3,23 @@ import static org.assertj.core.api.Assertions.fail; import java.io.ByteArrayOutputStream; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import javax.validation.constraints.NotNull; - import ch.qos.logback.classic.encoder.PatternLayoutEncoder; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; import de.tum.in.www1.artemis.*; import de.tum.in.www1.artemis.util.AbstractArtemisIntegrationTest; +/** + * This custom appender is used to capture the logs of multiple tests running in parallel. + *

+ * It captures the logs for each test group separately and prints them to the console at the end of the test class. + * The test group is determined by the test's class. Each test class can only be assigned to one test group. + * If a log cannot be assigned to a test group, the logs are printed for all active test groups. + */ public class ParallelConsoleAppender extends AppenderBase { private PatternLayoutEncoder encoder; @@ -22,6 +28,9 @@ public class ParallelConsoleAppender extends AppenderBase { private static final ConcurrentMap, ByteArrayOutputStream> TEST_GROUP_TO_ENCODED_LOGS = new ConcurrentHashMap<>(); + private static final Set> TEST_GROUPS = Set.of(AbstractSpringIntegrationBambooBitbucketJiraTest.class, AbstractSpringIntegrationGitlabCIGitlabSamlTest.class, + AbstractSpringIntegrationJenkinsGitlabTest.class, AbstractSpringIntegrationLocalCILocalVCTest.class, AbstractSpringIntegrationIndependentTest.class); + @Override protected synchronized void append(ILoggingEvent loggingEvent) { Class testClass = LOCAL_TEST_GROUP.get(); @@ -52,7 +61,7 @@ protected synchronized void append(ILoggingEvent loggingEvent) { * @param testClass the test's class for which the logs should be printed */ public static synchronized void printLogsForGroup(Class testClass) { - Class testGroupClass = TestGroup.fromClass(testClass); + Class testGroupClass = groupFromClass(testClass); ByteArrayOutputStream logs = TEST_GROUP_TO_ENCODED_LOGS.remove(testGroupClass); if (logs == null) { return; @@ -98,7 +107,7 @@ public static synchronized void addStringToLogsForGroup(String string) { * @param testClass the test's class */ public static void registerActiveTestGroup(Class testClass) { - LOCAL_TEST_GROUP.set(TestGroup.fromClass(testClass)); + LOCAL_TEST_GROUP.set(groupFromClass(testClass)); } /** @@ -123,35 +132,28 @@ public void setEncoder(PatternLayoutEncoder encoder) { this.encoder = encoder; } - private enum TestGroup { - - BAMBOO_INTEGRATION_TEST(AbstractSpringIntegrationBambooBitbucketJiraTest.class), GITLAB_INTEGRATION_TEST(AbstractSpringIntegrationGitlabCIGitlabSamlTest.class), - JENKINS_INTEGRATION_TEST(AbstractSpringIntegrationJenkinsGitlabTest.class), LOCAL_INTEGRATION_TEST(AbstractSpringIntegrationLocalCILocalVCTest.class), - MIN_INTEGRATION_TEST(AbstractSpringIntegrationIndependentTest.class); - - @NotNull - private final Class clazz; - - TestGroup(Class clazz) { - this.clazz = clazz; + /** + * Returns the test group's class for the given class. + * If none of the groups' classes is assignable from the given class, the class itself is returned. + * + * @param clazz the class for which the test group's class should be returned + * @return the test group's class for the given class + */ + private static Class groupFromClass(Class clazz) { + if (clazz == null) { + return null; } - public static Class fromClass(Class clazz) { - if (clazz == null) { - return null; - } - - for (TestGroup group : values()) { - if (group.clazz.isAssignableFrom(clazz)) { - return group.clazz; - } - } - - if (AbstractArtemisIntegrationTest.class.isAssignableFrom(clazz)) { - fail("Test class " + clazz.getName() + " extends ArtemisIntegrationTest but is not assigned to a test group"); + for (Class group : TEST_GROUPS) { + if (group.isAssignableFrom(clazz)) { + return group; } + } - return clazz; + if (AbstractArtemisIntegrationTest.class.isAssignableFrom(clazz)) { + fail("Test class " + clazz.getName() + " extends ArtemisIntegrationTest but is not assigned to a test group"); } + + return clazz; } } From 6fa23a205db7a43b238d877ed00012926c2ce84a Mon Sep 17 00:00:00 2001 From: lara Date: Thu, 21 Sep 2023 14:58:34 +0200 Subject: [PATCH 58/60] implement feedback from Lucas --- .../scheduled/NotificationScheduleService.java | 3 ++- ...ProgrammingExerciseScheduleServiceTest.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java b/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java index e0c2defebc6c..d1f49b6e1997 100644 --- a/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java +++ b/src/main/java/de/tum/in/www1/artemis/service/scheduled/NotificationScheduleService.java @@ -164,7 +164,8 @@ private void scheduleNotificationForAssessedExercisesSubmissions(Exercise exerci * @return true if the time is valid else false */ private boolean checkIfTimeIsCorrectForScheduledTask(ZonedDateTime relevantTime) { - // only send a notification if relevantTime is defined and not in the future (i.e. in the range [now-2 minutes, now+2 minutes]) (due to possible delays in scheduling) + // Only send a notification if relevantTime is defined and close to the current time (i.e. in the range [now-2 minutes, now+2 minutes]) (due to possible delays in + // scheduling) return relevantTime != null && !relevantTime.isBefore(ZonedDateTime.now().minusMinutes(2)) && !relevantTime.isAfter(ZonedDateTime.now().plusMinutes(2)); } diff --git a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java index 13223cc91777..7b1798763457 100644 --- a/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java +++ b/src/test/java/de/tum/in/www1/artemis/exercise/programmingexercise/ProgrammingExerciseScheduleServiceTest.java @@ -84,7 +84,7 @@ class ProgrammingExerciseScheduleServiceTest extends AbstractSpringIntegrationGi // TODO: This could be improved by e.g. manually setting the system time instead of waiting for actual time to pass. private static final long SCHEDULER_TASK_TRIGGER_DELAY_MS = 1000; - private static final long DELAY_MS = 200; + private static final long DELAY_MS = 300; private static final long TIMEOUT_MS = 5000; @@ -338,7 +338,7 @@ void scheduleIndividualDueDateNoBuildAndTestDateLock() throws Exception { setupProgrammingExerciseDates(now, DELAY_MS, null); var login = TEST_PREFIX + "student3"; - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, login); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2 + SCHEDULER_TASK_TRIGGER_DELAY_MS, login); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); @@ -351,7 +351,7 @@ void scheduleIndividualDueDateNoBuildAndTestDateLock() throws Exception { assertThat(studentParticipationIndividualDueDate.getIndividualDueDate()).isNotEqualTo(programmingExercise.getDueDate()); // the repo-lock for the participation with a later due date should only have been called after that individual due date has passed - verifyLockStudentRepositoryAndParticipationOperation(true, studentParticipationsRegularDueDate, TIMEOUT_MS); + verifyLockStudentRepositoryAndParticipationOperation(true, studentParticipationsRegularDueDate, DELAY_MS * 2); // first the operation should not be called verifyLockStudentRepositoryAndParticipationOperation(false, participationIndividualDueDate, 0); // after some time the operation should be called as well (verify waits up to 5s until this condition is fulfilled) @@ -364,25 +364,25 @@ void scheduleIndividualDueDateBetweenDueDateAndBuildAndTestDate() throws Excepti mockStudentRepoLocks(); final ZonedDateTime now = ZonedDateTime.now(); - setupProgrammingExerciseDates(now, DELAY_MS, DELAY_MS * 3); + setupProgrammingExerciseDates(now, DELAY_MS, 2 * SCHEDULER_TASK_TRIGGER_DELAY_MS); // individual due date between regular due date and build and test date - var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2, TEST_PREFIX + "student3"); + var participationIndividualDueDate = setupParticipationIndividualDueDate(now, DELAY_MS * 2 + SCHEDULER_TASK_TRIGGER_DELAY_MS, TEST_PREFIX + "student3"); programmingExercise = programmingExerciseRepository.findWithAllParticipationsById(programmingExercise.getId()).orElseThrow(); instanceMessageReceiveService.processScheduleProgrammingExercise(programmingExercise.getId()); - verify(scheduleService, timeout(TIMEOUT_MS)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); + verify(scheduleService, timeout(DELAY_MS * 2)).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.DUE), any()); verify(scheduleService, never()).scheduleParticipationTask(eq(participationIndividualDueDate), eq(ParticipationLifecycle.BUILD_AND_TEST_AFTER_DUE_DATE), any()); // not yet locked on regular due date - verify(programmingTriggerService, after(DELAY_MS).never()).triggerInstructorBuildForExercise(programmingExercise.getId()); + verify(programmingTriggerService, after(DELAY_MS * 2).never()).triggerInstructorBuildForExercise(programmingExercise.getId()); verifyLockStudentRepositoryAndParticipationOperation(false, participationIndividualDueDate, 0); // locked after individual due date - verifyLockStudentRepositoryAndParticipationOperation(true, participationIndividualDueDate, 2 * DELAY_MS); + verifyLockStudentRepositoryAndParticipationOperation(true, participationIndividualDueDate, 2 * DELAY_MS + SCHEDULER_TASK_TRIGGER_DELAY_MS); // after build and test date: no individual build and test actions are scheduled - verify(programmingTriggerService, after(DELAY_MS * 3).never()).triggerBuildForParticipations(List.of(participationIndividualDueDate)); + verify(programmingTriggerService, after(DELAY_MS + SCHEDULER_TASK_TRIGGER_DELAY_MS).never()).triggerBuildForParticipations(List.of(participationIndividualDueDate)); verify(programmingTriggerService, timeout(TIMEOUT_MS)).triggerInstructorBuildForExercise(programmingExercise.getId()); } From b8b389d1a22f03fe0d7a24c72604f615bf01c454 Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:29:30 +0200 Subject: [PATCH 59/60] Implement feedback from Maximilian --- .../notification/NotificationResourceIntegrationTest.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java index a87bb48d8f96..3b77aaf360d7 100644 --- a/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java +++ b/src/test/java/de/tum/in/www1/artemis/notification/NotificationResourceIntegrationTest.java @@ -37,9 +37,6 @@ class NotificationResourceIntegrationTest extends AbstractSpringIntegrationIndep @Autowired private NotificationRepository notificationRepository; - @Autowired - private SystemNotificationRepository systemNotificationRepository; - @Autowired private NotificationSettingRepository notificationSettingRepository; @@ -60,7 +57,6 @@ void initTestCase() { userUtilService.addUsers(TEST_PREFIX, 2, 1, 1, 1); course1 = textExerciseUtilService.addCourseWithOneReleasedTextExercise(); course2 = textExerciseUtilService.addCourseWithOneReleasedTextExercise(); - systemNotificationRepository.deleteAll(); notificationRepository.deleteAll(); User student1 = userUtilService.getUserByLogin(TEST_PREFIX + "student1"); @@ -70,7 +66,6 @@ void initTestCase() { @AfterEach void tearDown() { - systemNotificationRepository.deleteAll(); notificationRepository.deleteAll(); } From 97ed0646b2e2940117e24d257d80bfb58ae3f65f Mon Sep 17 00:00:00 2001 From: Dominik Remo <47261058+DominikRemo@users.noreply.github.com> Date: Fri, 22 Sep 2023 20:39:22 +0200 Subject: [PATCH 60/60] Fix Server and Client Style after merge --- .../exam-exercise-import/exam-exercise-import.component.ts | 6 +----- .../de/tum/in/www1/artemis/course/CourseTestService.java | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/webapp/app/exam/manage/exams/exam-exercise-import/exam-exercise-import.component.ts b/src/main/webapp/app/exam/manage/exams/exam-exercise-import/exam-exercise-import.component.ts index b5f3d94a8c64..be3ba91c83fc 100644 --- a/src/main/webapp/app/exam/manage/exams/exam-exercise-import/exam-exercise-import.component.ts +++ b/src/main/webapp/app/exam/manage/exams/exam-exercise-import/exam-exercise-import.component.ts @@ -1,9 +1,8 @@ import { Component, Input, OnInit } from '@angular/core'; import { Exam } from 'app/entities/exam.model'; -import { faCheckDouble, faFileUpload, faFont, faKeyboard, faProjectDiagram } from '@fortawesome/free-solid-svg-icons'; +import { faCheckDouble, faFont } from '@fortawesome/free-solid-svg-icons'; import { Exercise, ExerciseType } from 'app/entities/exercise.model'; import { ExerciseGroup } from 'app/entities/exercise-group.model'; -import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { SHORT_NAME_PATTERN } from 'app/shared/constants/input.constants'; import { getIcon } from 'app/entities/exercise.model'; @@ -40,9 +39,6 @@ export class ExamExerciseImportComponent implements OnInit { // Icons faCheckDouble = faCheckDouble; - faFileUpload = faFileUpload; - faProjectDiagram = faProjectDiagram; - faKeyboard = faKeyboard; faFont = faFont; getExerciseIcon = getIcon; diff --git a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java index a3ab987be7fa..77151499fcde 100644 --- a/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java +++ b/src/test/java/de/tum/in/www1/artemis/course/CourseTestService.java @@ -70,7 +70,6 @@ import de.tum.in.www1.artemis.repository.metis.conversation.ConversationRepository; import de.tum.in.www1.artemis.security.SecurityUtils; import de.tum.in.www1.artemis.service.FilePathService; -import de.tum.in.www1.artemis.service.FileService; import de.tum.in.www1.artemis.service.ParticipationService; import de.tum.in.www1.artemis.service.dto.StudentDTO; import de.tum.in.www1.artemis.service.dto.UserDTO;