SendThingMessage extends AbstractMessageCommand<T, SendThingMessage<T>> { public static SendThingMessage<?> fromJson(final String jsonString, final DittoHeaders dittoHeaders) { return fromJson(JsonFactory.newObject(jsonString), dittoHeaders); } private  SendThingMessage(final ThingId thingId, final Message<T> message, final DittoHeaders dittoHeaders); @Override SendThingMessage setDittoHeaders(final DittoHeaders dittoHeaders); @Deprecated static SendThingMessage<T> of(final String thingId, final Message<T> message,
            final DittoHeaders dittoHeaders); static SendThingMessage<T> of(final ThingId thingId, final Message<T> message,
            final DittoHeaders dittoHeaders); static SendThingMessage<?> fromJson(final String jsonString, final DittoHeaders dittoHeaders); static SendThingMessage<?> fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void createInstanceFromValidJsonWithEmptyPayload() { final SendThingMessage<?> underTest = SendThingMessage.fromJson(KNOWN_JSON_WITH_EMPTY_PAYLOAD, TestConstants.EMPTY_DITTO_HEADERS); assertThat(underTest).isNotNull(); assertThat((CharSequence) underTest.getThingEntityId()).isEqualTo(THING_ID); assertThat(underTest.getMessageType()).isEqualTo(SendThingMessage.NAME); assertThat(underTest.getMessage()).isEqualTo(MESSAGE_EMPTY_PAYLOAD); assertThat(underTest.getMessage().getPayload()).isEmpty(); assertThat(underTest.getMessage().getRawPayload()).isEmpty(); }