单元测试

This commit is contained in:
SongZhang 2024-09-14 17:49:49 +08:00
parent ba54bf9967
commit eb8a53718d
2 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,10 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>

View File

@ -69,9 +69,10 @@ public class PrintConsumer {
}
@RabbitListener(queues = {RabbitConstants.QUEUE_PRINT_DISHES})
public void printDishesListener(JSONObject jsonObject) {
public void printDishesListener(String msg) {
try {
log.info("打印消息mq 接收到打印菜品消息,消息内容: {}", jsonObject);
log.info("打印消息mq 接收到打印菜品消息,消息内容: {}", msg);
JSONObject jsonObject = JSONObject.parseObject(msg);
Integer orderId = jsonObject.getInteger("orderId");
JSONArray orderDetailIds = jsonObject.getJSONArray("orderDetailIds");
Boolean isReturn = jsonObject.getBoolean("isReturn");