package nextflow.k8s

import nextflow.processor.TaskRun
import spock.lang.Specification

class K8sSchedulingRequestTest extends Specification {

    def 'should create scheduling request from task handler' () {
        given:
        def task = Mock(TaskRun)
        def handler = Spy(K8sTaskHandler)
        handler.task = task

        when:
        def request = new K8sSchedulingRequest(handler)

        then:
        request.handler == handler
        request.task == task
        request.submitTimeMillis > 0
        request.submitTimeMillis <= System.currentTimeMillis()
    }
}
