mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
测试rabbitMQ
This commit is contained in:
@@ -28,6 +28,7 @@ import com.jsowell.adapay.vo.DrawCashDetailVO;
|
||||
import com.jsowell.adapay.vo.PaymentInfo;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.constant.RabbitConstants;
|
||||
import com.jsowell.common.core.domain.entity.SysDictData;
|
||||
import com.jsowell.common.core.domain.ykc.LoginRequestData;
|
||||
import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
@@ -89,6 +90,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
@@ -267,6 +269,46 @@ public class SpringBootTestController {
|
||||
@Autowired
|
||||
private CarCouponRecordService carCouponRecordService;
|
||||
|
||||
@Autowired
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Test
|
||||
public void sendRabbitMqTest() {
|
||||
OrderBasicInfo orderBasicInfo = OrderBasicInfo.builder()
|
||||
.orderCode("C123456789")
|
||||
.merchantId("1")
|
||||
.stationId("2")
|
||||
.payAmount(new BigDecimal(100))
|
||||
.orderAmount(new BigDecimal(100))
|
||||
.settleAmount(new BigDecimal(100))
|
||||
.refundAmount(new BigDecimal(0))
|
||||
.build();
|
||||
OrderDetail orderDetail = OrderDetail.builder()
|
||||
.totalElectricityAmount(new BigDecimal(50))
|
||||
.discountElectricityAmount(new BigDecimal(0))
|
||||
.totalServiceAmount(new BigDecimal(50))
|
||||
.discountElectricityAmount(new BigDecimal(0))
|
||||
.build();
|
||||
|
||||
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||||
.orderCode(orderBasicInfo.getOrderCode())
|
||||
.merchantId(orderBasicInfo.getMerchantId())
|
||||
.stationId(orderBasicInfo.getStationId())
|
||||
.orderPayAmount(orderBasicInfo.getPayAmount())
|
||||
.orderConsumeAmount(orderBasicInfo.getOrderAmount())
|
||||
.orderSettleAmount(orderBasicInfo.getSettleAmount())
|
||||
.orderElectricityAmount(orderDetail.getTotalElectricityAmount())
|
||||
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount())
|
||||
.orderServiceAmount(orderDetail.getTotalServiceAmount())
|
||||
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount())
|
||||
.orderRefundAmount(orderBasicInfo.getRefundAmount())
|
||||
.build();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
rabbitTemplate.convertAndSend(RabbitConstants.YKC_EXCHANGE_NAME, RabbitConstants.QUEUE_CHARGE_ORDER_DATA, afterSettleOrderDTO);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void selectPileConnectorInfoListByPileSnListTest() {
|
||||
List<String> pileSnList = Lists.newArrayList();
|
||||
|
||||
Reference in New Issue
Block a user