DeleteThing extends AbstractCommand<DeleteThing> implements ThingModifyCommand<DeleteThing> { @Deprecated public static DeleteThing of(final String thingId, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), dittoHeaders); } private  DeleteThing(final ThingId thingId, final DittoHeaders dittoHeaders); @Deprecated static DeleteThing of(final String thingId, final DittoHeaders dittoHeaders); static DeleteThing of(final ThingId thingId, final DittoHeaders dittoHeaders); static DeleteThing fromJson(final String jsonString, final DittoHeaders dittoHeaders); static DeleteThing fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override DeleteThing setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean changesAuthorization(); @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = ThingIdInvalidException.class) public void tryToCreateInstanceWithNullThingString() { DeleteThing.of((String) null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThing() { DeleteThing.of((ThingId) null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final DeleteThing underTest = DeleteThing.of(TestConstants.Thing.THING_ID, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }