ThingDefinitionModified extends AbstractThingEvent<ThingDefinitionModified> implements ThingModifiedEvent<ThingDefinitionModified> { @Deprecated public static ThingDefinitionModified of(final ThingId thingId, final ThingDefinition definition, final long revision, final DittoHeaders dittoHeaders) { return of(thingId, definition, revision, null, dittoHeaders, null); } private  ThingDefinitionModified(final ThingId thingId,
            final ThingDefinition definition,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); @Deprecated static ThingDefinitionModified of(final ThingId thingId,
            final ThingDefinition definition,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static ThingDefinitionModified of(final ThingId thingId,
            final ThingDefinition definition,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static ThingDefinitionModified of(final ThingId thingId,
            final ThingDefinition definition,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); static ThingDefinitionModified fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ThingDefinitionModified fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); ThingDefinition getThingDefinition(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override ThingDefinitionModified setRevision(final long revision); @Override ThingDefinitionModified setDittoHeaders(final DittoHeaders dittoHeaders); @Override int hashCode(); @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067", "OverlyComplexMethod"}) @Override boolean equals(@Nullable final Object o); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { ThingDefinitionModified.of(null, TestConstants.Thing.DEFINITION, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final ThingDefinitionModified underTest = ThingDefinitionModified.of(TestConstants.Thing.THING_ID, TestConstants.Thing.DEFINITION, TestConstants.Thing.REVISION_NUMBER, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS, TestConstants.METADATA); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }