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))); + } }