package click.kamil.springstatemachineexporter.analysis.model;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class LifecycleTriggerMarkersTest {

    @Test
    void shouldRecognizeLifecycleMarkers() {
        assertThat(LifecycleTriggerMarkers.isLifecycle("[LIFECYCLE:RESTORE]")).isTrue();
        assertThat(LifecycleTriggerMarkers.isLifecycle("[LIFECYCLE:RESET]")).isTrue();
        assertThat(LifecycleTriggerMarkers.isLifecycle("OrderEvent.PAY")).isFalse();
    }

    @Test
    void shouldFormatDisplayLabels() {
        assertThat(LifecycleTriggerMarkers.displayLabel("[LIFECYCLE:RESTORE]"))
                .isEqualTo("Restore persisted state");
        assertThat(LifecycleTriggerMarkers.displayLabel("[LIFECYCLE:RESET]"))
                .isEqualTo("Reset state machine");
    }
}
