package io.wdd.server.func;

import io.wdd.func.auto.beans.BaseFunctionEnum;
import io.wdd.func.auto.service.FuncService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.List;

@SpringBootTest
public class TestSingleCommand {

    @Autowired
    FuncService funcService;

    @Test
    public void toSingleServer() {

        String targetAgentTopicName = "Chengdu-amd64-71-3571gd";
        BaseFunctionEnum baseFunctionEnum = BaseFunctionEnum.INSTALL_DOCKER;


        ArrayList<String> funcArgs = new ArrayList<>();
        funcArgs.add(baseFunctionEnum.getFuncName());
        funcArgs.add("10.250.0.100");
        funcArgs.add("123");
        funcArgs.add("");
        funcArgs.add("");
        funcArgs.add("");
        List<String> stringList = funcService.callBaseFuncService(targetAgentTopicName, baseFunctionEnum.getFuncName(), funcArgs);


        System.out.println("stringList = " + stringList);


    }
}
