FeatureDefinitionDeleted extends AbstractThingEvent<FeatureDefinitionDeleted> implements ThingModifiedEvent<FeatureDefinitionDeleted>, WithFeatureId { @Deprecated public static FeatureDefinitionDeleted of(final String thingId, final String featureId, final long revision, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), featureId, revision, null, dittoHeaders, null); } private  FeatureDefinitionDeleted(final ThingId thingId,
            final String featureId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); @Deprecated static FeatureDefinitionDeleted of(final String thingId,
            final String featureId,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static FeatureDefinitionDeleted of(final ThingId thingId,
            final String featureId,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static FeatureDefinitionDeleted of(final String thingId,
            final String featureId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static FeatureDefinitionDeleted of(final ThingId thingId,
            final String featureId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static FeatureDefinitionDeleted of(final ThingId thingId,
            final String featureId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); static FeatureDefinitionDeleted fromJson(final String jsonString, final DittoHeaders dittoHeaders); static FeatureDefinitionDeleted fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override String getFeatureId(); @Override JsonPointer getResourcePath(); @Override FeatureDefinitionDeleted setRevision(final long revision); @Override FeatureDefinitionDeleted setDittoHeaders(final DittoHeaders dittoHeaders); @SuppressWarnings("squid:S109") @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object o); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void tryToCreateInstanceWithNullThingIdString() { assertThatExceptionOfType(ThingIdInvalidException.class) .isThrownBy(() -> FeatureDefinitionDeleted.of((String) null, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS)) .withMessage("Thing ID 'null' is not valid!"); }
@Test public void tryToCreateInstanceWithNullThingId() { assertThatNullPointerException() .isThrownBy(() -> FeatureDefinitionDeleted.of((ThingId) null, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS)) .withMessage("The %s must not be null!", "Thing identifier") .withNoCause(); }
@Test public void tryToCreateInstanceWithNullFeatureId() { assertThatNullPointerException() .isThrownBy(() -> FeatureDefinitionDeleted.of(TestConstants.Thing.THING_ID, null, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS)) .withMessage("The %s must not be null!", "Feature ID") .withNoCause(); }
@Test public void toJsonReturnsExpected() { final FeatureDefinitionDeleted underTest = FeatureDefinitionDeleted.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.Thing.REVISION_NUMBER, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS, TestConstants.METADATA); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }