package com.ffii.fpsms.modules.pickOrder.service

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.Test

class TruckLaneScheduleLockSupportTest {
    @Test
    fun withApplyingSchedule_sets_and_clears_thread_local() {
        assertNull(TruckLaneScheduleLockSupport.applyingScheduleId())

        TruckLaneScheduleLockSupport.withApplyingSchedule(8L) {
            assertEquals(8L, TruckLaneScheduleLockSupport.applyingScheduleId())
            "done"
        }

        assertNull(TruckLaneScheduleLockSupport.applyingScheduleId())
    }
}
