@Test public void serializeTest() { UnsubscribeMessage unsubscribeMessage = new UnsubscribeMessage(1, 2); assertThat(unsubscribeMessage.getCode()).isEqualTo(34); assertThat(unsubscribeMessage.getRequestId()).isEqualTo(1); assertThat(unsubscribeMessage.getSubscriptionId()).isEqualTo(2); String json = serializeToJson(unsubscribeMessage); assertThat(json).isEqualTo("[34,1,2]"); }
@Override public void serialize(JsonGenerator generator) throws IOException { generator.writeNumber(getCode()); generator.writeNumber(this.requestId); generator.writeNumber(this.subscriptionId); }
UnsubscribeMessage extends WampMessage { @Override public void serialize(JsonGenerator generator) throws IOException { generator.writeNumber(getCode()); generator.writeNumber(this.requestId); generator.writeNumber(this.subscriptionId); } }
UnsubscribeMessage extends WampMessage { @Override public void serialize(JsonGenerator generator) throws IOException { generator.writeNumber(getCode()); generator.writeNumber(this.requestId); generator.writeNumber(this.subscriptionId); } UnsubscribeMessage(long requestId, long subscriptionId); }
UnsubscribeMessage extends WampMessage { @Override public void serialize(JsonGenerator generator) throws IOException { generator.writeNumber(getCode()); generator.writeNumber(this.requestId); generator.writeNumber(this.subscriptionId); } UnsubscribeMessage(long requestId, long subscriptionId); static UnsubscribeMessage deserialize(JsonParser jp); @Override void serialize(JsonGenerator generator); long getRequestId(); long getSubscriptionId(); @Override String toString(); }
UnsubscribeMessage extends WampMessage { @Override public void serialize(JsonGenerator generator) throws IOException { generator.writeNumber(getCode()); generator.writeNumber(this.requestId); generator.writeNumber(this.subscriptionId); } UnsubscribeMessage(long requestId, long subscriptionId); static UnsubscribeMessage deserialize(JsonParser jp); @Override void serialize(JsonGenerator generator); long getRequestId(); long getSubscriptionId(); @Override String toString();  }