package com.miaxis.test;

import com.miaxis.ZzjsApplication;
import com.miaxis.wx.domain.WxOrder;
import com.miaxis.wx.service.IWxOrderService;
import com.miaxis.wx.service.IRefundRecordService;
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.math.BigInteger;
import java.security.cert.X509Certificate;

@SpringBootTest(classes = ZzjsApplication.class)
@RunWith(SpringRunner.class)
public class NormalTest {
    @Autowired
    private IWxOrderService wxOrderService;

    @Autowired
    private IRefundRecordService refundRecordService;

    @Autowired
    private AutoUpdateCertificatesVerifier verifier;
    @Test
    public void test1() throws Exception {
        WxOrder wxOrder = wxOrderService.getByOutTradeNo("12021052416003523348114349059153");
        refundRecordService.refund(wxOrder,"12021051815333778448136985596488");
        WxOrder wxOrder1 = wxOrderService.getByOutTradeNo("12021052415260767148145493655617");
        refundRecordService.refund(wxOrder1,"12021051815333778448136985596489");
    }


    @Test
    public void test2() throws Exception {
        X509Certificate validCertificate = verifier.getValidCertificate();
        BigInteger serialNumber = validCertificate.getSerialNumber();
        System.out.println(serialNumber);


    }

    public static void main(String[] args) {
        Integer a =1;
        do1(a);
        System.out.println(a);
    }
    public static void  do1(Integer a){
        a =2 ;
    }









}
