FeatureModified extends AbstractThingEvent<FeatureModified> implements ThingModifiedEvent<FeatureModified>, WithFeatureId { @Deprecated public static FeatureModified of(final String thingId, final Feature feature, final long revision, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), feature, revision, null, dittoHeaders, null); } private  FeatureModified(final ThingId thingId,
            final Feature feature,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); @Deprecated static FeatureModified of(final String thingId,
            final Feature feature,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static FeatureModified of(final ThingId thingId,
            final Feature feature,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static FeatureModified of(final String thingId,
            final Feature feature,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static FeatureModified of(final ThingId thingId,
            final Feature feature,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static FeatureModified of(final ThingId thingId,
            final Feature feature,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); static FeatureModified fromJson(final String jsonString, final DittoHeaders dittoHeaders); static FeatureModified fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Feature getFeature(); @Override String getFeatureId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override FeatureModified setRevision(final long revision); @Override FeatureModified 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(expected = ThingIdInvalidException.class) public void tryToCreateInstanceWithNullThingIdString() { FeatureModified.of((String) null, TestConstants.Feature.FLUX_CAPACITOR, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { FeatureModified.of((ThingId) null, TestConstants.Feature.FLUX_CAPACITOR, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullFeature() { FeatureModified.of(TestConstants.Thing.THING_ID, null, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final FeatureModified underTest = FeatureModified.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR, TestConstants.Thing.REVISION_NUMBER, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS, TestConstants.METADATA); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }