ThingModified extends AbstractThingEvent<ThingModified> implements ThingModifiedEvent<ThingModified> { @Deprecated public static ThingModified of(final Thing thing, final long revision, final DittoHeaders dittoHeaders) { return of(thing, revision, null, dittoHeaders, null); } private  ThingModified(final Thing thing,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); @Deprecated static ThingModified of(final Thing thing,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static ThingModified of(final Thing thing,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static ThingModified of(final Thing thing,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); static ThingModified fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ThingModified fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Thing getThing(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override ThingModified setRevision(final long revision); @Override ThingModified 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 = NullPointerException.class) public void tryToCreateInstanceWithNullThing() { ThingModified.of(null, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final ThingModified underTest = ThingModified.of(TestConstants.Thing.THING, TestConstants.Thing.REVISION_NUMBER, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS, TestConstants.METADATA); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }