public void unschedule(String eventDefinitionId) {
        final EventDefinitionDto eventDefinition = getEventDefinitionOrThrowIAE(eventDefinitionId);

        if (SystemNotificationEventEntityScope.NAME.equals(eventDefinition.scope())) {
            LOG.debug("Ignoring disable for system notification events");
            return;
        }

        getJobDefinition(eventDefinition)
                .ifPresent(jobDefinition -> deleteJobDefinitionAndTrigger(jobDefinition, eventDefinition));
        eventDefinitionService.updateState(eventDefinitionId, EventDefinition.State.DISABLED);
    }
@Test
    @MongoDBFixtures("event-processors.json")
    public void unscheduleWithMissingEventDefinition() {
        final String id = "54e3deadbeefdeadbeef9999";

        // The event definition should not exist so our test works
        assertThat(eventDefinitionService.get(id)).isNotPresent();

        assertThatThrownBy(() -> handler.unschedule(id))
                .hasMessageContaining("doesn't exist")
                .isInstanceOf(IllegalArgumentException.class);
    }