DeleteFeatureDefinition extends AbstractCommand<DeleteFeatureDefinition> implements ThingModifyCommand<DeleteFeatureDefinition>, WithFeatureId { @Deprecated public static DeleteFeatureDefinition of(final String thingId, final String featureId, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), featureId, dittoHeaders); } private  DeleteFeatureDefinition(final ThingId thingId, final String featureId, final DittoHeaders dittoHeaders); @Deprecated static DeleteFeatureDefinition of(final String thingId, final String featureId,
            final DittoHeaders dittoHeaders); static DeleteFeatureDefinition of(final ThingId thingId, final String featureId,
            final DittoHeaders dittoHeaders); static DeleteFeatureDefinition fromJson(final String jsonString, final DittoHeaders dittoHeaders); static DeleteFeatureDefinition fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ThingId getThingEntityId(); @Override String getFeatureId(); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override DeleteFeatureDefinition 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 public void tryToCreateInstanceWithNullThingIdString() { assertThatExceptionOfType(ThingIdInvalidException.class) .isThrownBy(() -> DeleteFeatureDefinition.of((String) null, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS)); }
@Test public void tryToCreateInstanceWithNullThingId() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> DeleteFeatureDefinition.of((ThingId) null, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS)) .withNoCause(); }
@Test public void tryToCreateInstanceWithNullFeatureId() { assertThatNullPointerException() .isThrownBy(() -> DeleteFeatureDefinition.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS)) .withMessage("The %s must not be null!", "Feature ID") .withNoCause(); }
@Test public void createInstanceWithValidArguments() { final DeleteFeatureDefinition underTest = DeleteFeatureDefinition.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS); assertThat(underTest).isNotNull(); }
@Test public void toJsonReturnsExpected() { final DeleteFeatureDefinition underTest = DeleteFeatureDefinition.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }