DeleteThingDefinition extends AbstractCommand<DeleteThingDefinition> implements ThingModifyCommand<DeleteThingDefinition> { public static DeleteThingDefinition of(final ThingId thingId, final DittoHeaders dittoHeaders) { return new DeleteThingDefinition(thingId, dittoHeaders); } private  DeleteThingDefinition(final ThingId thingId, final DittoHeaders dittoHeaders); static DeleteThingDefinition of(final ThingId thingId,
            final DittoHeaders dittoHeaders); static DeleteThingDefinition fromJson(final String jsonString, final DittoHeaders dittoHeaders); static DeleteThingDefinition fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override DeleteThingDefinition 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 = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { DeleteThingDefinition.of(null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void createInstanceWithValidArguments() { final DeleteThingDefinition underTest = DeleteThingDefinition.of(TestConstants.Thing.THING_ID, TestConstants.EMPTY_DITTO_HEADERS); assertThat(underTest).isNotNull(); assertThat((CharSequence) underTest.getEntityId()).isEqualTo(TestConstants.Thing.THING_ID); }
@Test public void toJsonReturnsExpected() { final DeleteThingDefinition underTest = DeleteThingDefinition.of(TestConstants.Thing.THING_ID, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }