diff --git a/src/main/java/de/tum/cit/aet/artemis/atlas/service/competency/CompetencyJolService.java b/src/main/java/de/tum/cit/aet/artemis/atlas/service/competency/CompetencyJolService.java index 3885f233b224..60238c811ddd 100644 --- a/src/main/java/de/tum/cit/aet/artemis/atlas/service/competency/CompetencyJolService.java +++ b/src/main/java/de/tum/cit/aet/artemis/atlas/service/competency/CompetencyJolService.java @@ -23,7 +23,7 @@ import de.tum.cit.aet.artemis.atlas.repository.CompetencyRepository; import de.tum.cit.aet.artemis.core.exception.BadRequestAlertException; import de.tum.cit.aet.artemis.core.repository.UserRepository; -import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventPublisher; +import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventPublisherService; import de.tum.cit.aet.artemis.iris.service.pyris.event.CompetencyJolSetEvent; /** @@ -45,10 +45,10 @@ public class CompetencyJolService { private final UserRepository userRepository; - private final Optional pyrisEventPublisher; + private final Optional pyrisEventPublisher; public CompetencyJolService(CompetencyJolRepository competencyJolRepository, CompetencyRepository competencyRepository, - CompetencyProgressRepository competencyProgressRepository, UserRepository userRepository, Optional pyrisEventPublisher) { + CompetencyProgressRepository competencyProgressRepository, UserRepository userRepository, Optional pyrisEventPublisher) { this.competencyJolRepository = competencyJolRepository; this.competencyRepository = competencyRepository; this.competencyProgressRepository = competencyProgressRepository; diff --git a/src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventPublisher.java b/src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventPublisherService.java similarity index 94% rename from src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventPublisher.java rename to src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventPublisherService.java index f272a05d272f..df15e26872c0 100644 --- a/src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventPublisher.java +++ b/src/main/java/de/tum/cit/aet/artemis/iris/service/pyris/PyrisEventPublisherService.java @@ -20,15 +20,15 @@ */ @Service @Profile(PROFILE_IRIS) -public class PyrisEventPublisher { +public class PyrisEventPublisherService { - private static final Logger log = LoggerFactory.getLogger(PyrisEventPublisher.class); + private static final Logger log = LoggerFactory.getLogger(PyrisEventPublisherService.class); private final ApplicationEventPublisher eventPublisher; private final IrisSettingsService irisSettingsService; - public PyrisEventPublisher(ApplicationEventPublisher eventPublisher, IrisSettingsService irisSettingsService) { + public PyrisEventPublisherService(ApplicationEventPublisher eventPublisher, IrisSettingsService irisSettingsService) { this.eventPublisher = eventPublisher; this.irisSettingsService = irisSettingsService; } diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingMessagingService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingMessagingService.java index e25ebc1930f9..8aa4dbfbdde4 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingMessagingService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingMessagingService.java @@ -25,7 +25,7 @@ import de.tum.cit.aet.artemis.exercise.domain.participation.StudentParticipation; import de.tum.cit.aet.artemis.exercise.dto.SubmissionDTO; import de.tum.cit.aet.artemis.exercise.repository.TeamRepository; -import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventPublisher; +import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventPublisherService; import de.tum.cit.aet.artemis.iris.service.pyris.event.NewResultEvent; import de.tum.cit.aet.artemis.lti.service.LtiNewResultService; import de.tum.cit.aet.artemis.programming.domain.ProgrammingExercise; @@ -51,11 +51,11 @@ public class ProgrammingMessagingService { private final TeamRepository teamRepository; - private final Optional pyrisEventPublisher; + private final Optional pyrisEventPublisher; public ProgrammingMessagingService(GroupNotificationService groupNotificationService, WebsocketMessagingService websocketMessagingService, ResultWebsocketService resultWebsocketService, Optional ltiNewResultService, TeamRepository teamRepository, - Optional pyrisEventPublisher) { + Optional pyrisEventPublisher) { this.groupNotificationService = groupNotificationService; this.websocketMessagingService = websocketMessagingService; this.resultWebsocketService = resultWebsocketService; diff --git a/src/test/java/de/tum/cit/aet/artemis/iris/PyrisEventSystemIntegrationTest.java b/src/test/java/de/tum/cit/aet/artemis/iris/PyrisEventSystemIntegrationTest.java index 760fa1409415..2fbb90999893 100644 --- a/src/test/java/de/tum/cit/aet/artemis/iris/PyrisEventSystemIntegrationTest.java +++ b/src/test/java/de/tum/cit/aet/artemis/iris/PyrisEventSystemIntegrationTest.java @@ -39,7 +39,7 @@ import de.tum.cit.aet.artemis.iris.domain.settings.event.IrisEventType; import de.tum.cit.aet.artemis.iris.repository.IrisSettingsRepository; import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventProcessingException; -import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventPublisher; +import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventPublisherService; import de.tum.cit.aet.artemis.iris.service.pyris.PyrisEventService; import de.tum.cit.aet.artemis.iris.service.pyris.PyrisJobService; import de.tum.cit.aet.artemis.iris.service.pyris.PyrisStatusUpdateService; @@ -75,7 +75,7 @@ class PyrisEventSystemIntegrationTest extends AbstractIrisIntegrationTest { private SubmissionTestRepository submissionRepository; @Autowired - private PyrisEventPublisher pyrisEventPublisher; + private PyrisEventPublisherService pyrisEventPublisherService; @Autowired private ParticipationUtilService participationUtilService; @@ -193,7 +193,7 @@ void testShouldFireProgressStalledEvent() { pipelineDone.set(true); }); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); verify(irisExerciseChatSessionService, times(1)).onNewResult(eq(result)); await().atMost(2, TimeUnit.SECONDS).until(() -> pipelineDone.get()); @@ -213,7 +213,7 @@ void testShouldFireBuildFailedEvent() { pipelineDone.set(true); }); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); verify(irisExerciseChatSessionService, times(1)).onBuildFailure(eq(result)); await().atMost(2, TimeUnit.SECONDS).until(() -> pipelineDone.get()); @@ -251,7 +251,7 @@ void testShouldNotFireProgressStalledEventWithEventDisabled() { createSubmissionWithScore(studentParticipation, 40); createSubmissionWithScore(studentParticipation, 40); var result = createSubmissionWithScore(studentParticipation, 40); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); verify(irisExerciseChatSessionService, times(0)).onNewResult(any(Result.class)); verify(pyrisPipelineService, times(0)).executeExerciseChatPipeline(any(), any(), any(), any(), any()); @@ -268,7 +268,7 @@ void testShouldNotFireBuildFailedEventWhenEventSettingDisabled() { irisExerciseChatSessionService.createChatSessionForProgrammingExercise(exercise, userUtilService.getUserByLogin(TEST_PREFIX + "student1")); // Create a failing submission for the student. var result = createFailingSubmission(studentParticipation); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); verify(irisExerciseChatSessionService, times(0)).onBuildFailure(any(Result.class)); verify(pyrisPipelineService, times(0)).executeExerciseChatPipeline(any(), any(), any(), any(), any()); @@ -285,13 +285,13 @@ void testShouldShouldNotFireProgressStalledEventWithExistingSuccessfulSubmission createSubmissionWithScore(studentParticipation, 100); var result = createSubmissionWithScore(studentParticipation, 50); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); await().atMost(2, TimeUnit.SECONDS); result = createSubmissionWithScore(studentParticipation, 50); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); await().atMost(2, TimeUnit.SECONDS); verify(irisExerciseChatSessionService, times(2)).onNewResult(any(Result.class)); @@ -306,7 +306,7 @@ void testShouldNotFireProgressStalledEventWithLessThanThreeSubmissions() { createSubmissionWithScore(studentParticipation, 20); var result = createSubmissionWithScore(studentParticipation, 20); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); verify(irisExerciseChatSessionService, times(1)).onNewResult(any(Result.class)); verify(pyrisPipelineService, times(0)).executeExerciseChatPipeline(any(), any(), any(), any(), any()); @@ -321,7 +321,7 @@ void testShouldNotFireProgressStalledEventWithIncreasingScores() { createSubmissionWithScore(studentParticipation, 30); var result = createSubmissionWithScore(studentParticipation, 40); - pyrisEventPublisher.publishEvent(new NewResultEvent(this, result)); + pyrisEventPublisherService.publishEvent(new NewResultEvent(this, result)); verify(irisExerciseChatSessionService, times(1)).onNewResult(any(Result.class)); verify(pyrisPipelineService, times(0)).executeExerciseChatPipeline(any(), any(), any(), any(), any());