package com.trade.client;

import com.trade.client.credit.controller.BizCreditApplyController;
import com.trade.client.credit.controller.BizEntityCreditAuthController;
import com.trade.service.credit.domain.BizCreditApply;
import com.trade.service.credit.domain.TransStruct;
import com.trade.service.credit.domain.vo.BizCreditApplyVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;

@SpringBootTest
public class CreditApplyTest {

    @Resource
    private BizCreditApplyController creditApplyController;
    @Autowired
    private TransStruct transStruct;
    @Resource
    private BizEntityCreditAuthController bizEntityCreditAuthController;

    @Test
    public void structTest() {
        BizCreditApplyVO bizCreditApplyVO = new BizCreditApplyVO();
        bizCreditApplyVO.setBizProd("example_prod");
        bizCreditApplyVO.setCurrency("CNY");
        BizCreditApply creditApply =  transStruct.vO2BizCreditApply(bizCreditApplyVO);
        System.out.println(creditApply.getBizProd());

    }



    @Test
    public void tempSaveTest() {
        BizCreditApplyVO bizCreditApplyVO = new BizCreditApplyVO();
        bizCreditApplyVO.setBizProd("example_prod");
        bizCreditApplyVO.setCurrency("CNY");
        creditApplyController.tempSave(bizCreditApplyVO);
    }
    
    
    @Test
    public void authTest() {
        bizEntityCreditAuthController.doAuth(123L);
    }



}
