package com.hzya.frame;

import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.cinvoice.plugin.CInvoiceImportPluginInitializer;
import com.hzya.frame.plugin.contract.plugin.ContractAuditPluginInitializer;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.junit.Test;

import javax.annotation.Resource;

/**
 * @Description
 * @Author xiangerlin
 * @Date 2025/4/1 09:12
 **/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {WebappApplication.class})
public class Test1 {


    @Resource
    private ContractAuditPluginInitializer contractPlugin;
    @Resource
    private CInvoiceImportPluginInitializer cInvoiceImportPluginInitializer;
    @Test
    public void contractAuditPluginTest(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("sourceCode","HT-OA");
        try {
            contractPlugin.executeBusiness(jsonObject);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    //发票批量导入
    @Test
    public void cinvoicePluginTest(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("sourceCode","HT-OA");
        try {
            cInvoiceImportPluginInitializer.executeBusiness(jsonObject);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
