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/PyrisEventPublisher.java index ff0695af0698..f272a05d272f 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/PyrisEventPublisher.java @@ -4,7 +4,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Service; @@ -40,7 +39,6 @@ public PyrisEventPublisher(ApplicationEventPublisher eventPublisher, IrisSetting * @param event the event to publish */ public void publishEvent(PyrisEvent event) { - isEventSupportedElseThrow(event); if (!isEventEnabled(event)) { log.debug("Skipping event publication as conditions are not met: {}", event.getClass().getSimpleName()); return; @@ -54,26 +52,6 @@ public void publishEvent(PyrisEvent event) { } } - /** - * Checks if the given event is supported and throws an exception if it is not. - * - * @param event - the event to check - */ - private void isEventSupportedElseThrow(ApplicationEvent event) { - if (!isEventSupported(event)) { - throw new UnsupportedPyrisEventException("Event not supported: " + event); - } - } - - /** - * Checks if the given event is supported. - * - * @param event the event to publish - */ - private boolean isEventSupported(ApplicationEvent event) { - return event instanceof PyrisEvent; - } - private boolean isEventEnabled(PyrisEvent event) { return switch (event) { case NewResultEvent newResultEvent -> {