package com.izouma.nineth; import com.izouma.nineth.config.Constants; import com.izouma.nineth.dto.PayQuery; import com.izouma.nineth.service.OrderPayService; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.junit.jupiter.SpringExtension; @ExtendWith(SpringExtension.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class PayOrderTest { @Autowired private OrderPayService orderPayService; @Test public void refund() { for (String s : new String[]{"NUPAC20220602004158600000000000000088878", "NUPAC20220602004178600000000000000089288", "NUPAC20220602004199100000000000000089197", "NUPAC20220602004125400000000000000090478", "NUPAC20220602004178800000000000000091749", "NUPAC20220602004183300000000000000093060", "NUPAC20220602004131100000000000000094001", "NUPAC20220602004114100000000000000093751", "NUPAC20220602004195800000000000000094095", "NUPAC20220602004166600000000000000095053", "NUPAC20220602004171300000000000000094667", "NUPAC20220602004155000000000000000095478", "NUPAC20220602004198300000000000000096828", "NUPAC20220602004128500000000000000098532", "NUPAC20220602004129100000000000000099890", "NUPAC20220602004113200000000000000099680", "NUPAC20220602004170100000000000000100350"}) { PayQuery q = orderPayService.query(s, Constants.PayChannel.SAND); orderPayService.refund(q.getOrderId(), q.getTransactionId(), q.getAmount(), q.getChannel()); } } }