From d65e2f27a97bb0be7866e3f5ca0cff6f11317a62 Mon Sep 17 00:00:00 2001 From: giveup Date: Fri, 24 Jan 2025 21:26:02 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20WxMpSubscribeMessage=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/mp/bean/subscribe/WxMpSubscribeMessage.java | 2 +- .../mp/bean/subscribe/WxMpSubscribeMessageTest.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java index d2695959e..6820d103b 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java @@ -17,7 +17,7 @@ import java.util.Map; @NoArgsConstructor @Builder @AllArgsConstructor -public class WxMpSubscribeMessage { +public class WxMpSubscribeMessage implements Serializable { /** * 接收者openid. diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java index 078ad5157..684211659 100644 --- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java +++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java @@ -2,6 +2,9 @@ package me.chanjar.weixin.mp.bean.subscribe; import org.testng.annotations.*; +import java.io.Serializable; +import java.util.Arrays; + import static org.testng.AssertJUnit.*; /** @@ -43,4 +46,9 @@ public class WxMpSubscribeMessageTest { assertEquals(message.toJson(), actual); } + + @Test + void testWxMpSubscribeMessageIsSerializable() { + assertTrue(Arrays.stream(WxMpSubscribeMessage.class.getInterfaces()).anyMatch(anInterface -> anInterface.isInstance(Serializable.class))); + } }