SendClaimMessage extends AbstractMessageCommand<T, SendClaimMessage<T>> { @Deprecated public static <T> SendClaimMessage<T> of(final String thingId, final Message<T> message, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), message, dittoHeaders); } private  SendClaimMessage(final ThingId thingId, final Message<T> message, final DittoHeaders dittoHeaders); @Override SendClaimMessage<T> setDittoHeaders(final DittoHeaders dittoHeaders); @Deprecated static SendClaimMessage<T> of(final String thingId, final Message<T> message,
            final DittoHeaders dittoHeaders); static SendClaimMessage<T> of(final ThingId thingId, final Message<T> message,
            final DittoHeaders dittoHeaders); static SendClaimMessage<?> fromJson(final String jsonString, final DittoHeaders dittoHeaders); static SendClaimMessage<?> fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = ThingIdInvalidException.class) public void tryCreateWithNullThingIdString() { SendClaimMessage.of((String) null, MESSAGE, DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryCreateWithNullThingId() { SendClaimMessage.of((ThingId) null, MESSAGE, DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryCreateWithNullMessage() { SendClaimMessage.of(THING_ID, null, DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryCreateWithNullDittoHeaders() { SendClaimMessage.of(THING_ID, MESSAGE, null); }
@Test public void tryCreateValidMessage() { SendClaimMessage.of(THING_ID, MESSAGE, DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final SendClaimMessage<?> underTest = SendClaimMessage.of(THING_ID, MESSAGE, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }
@Test public void toJsonDoesNotBase64EncodeTextBody() { final SendClaimMessage<?> underTest = SendClaimMessage.of(THING_ID, DESERIALIZED_MESSAGE, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }