package com.customer.work.model.test;

import com.customer.work.model.FlowableModelTest;
import com.customer.work.model.FlowableModelTestUtils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.stream.Stream;

@FlowableModelTest
public class TrackVarsTest {

    @Autowired
    protected FlowableModelTestUtils flowableModelTest;

    @Test
    @Disabled
    public void exportApp() {
        flowableModelTest.exportApp("http://localhost:8106", "andiWS", "trackVarsApp", "admin", "test");
    }

    private Stream<Arguments> trackVarsProcessTestData() {
        return flowableModelTest.getJsonArgumentsFromExcel("model/test/TrackVars/trackVars.xlsx");
    }
    @ParameterizedTest
    @MethodSource("trackVarsProcessTestData")
    public void trackVarsProcessTest(String path, JsonNode argument) {
        ObjectNode result = flowableModelTest.testJsonExcelRow(path, argument);
    }

}
