PolicyIdModified extends AbstractThingEvent<PolicyIdModified> implements ThingModifiedEvent<PolicyIdModified> { @Deprecated public static PolicyIdModified of(final String thingId, final String policyId, final long revision, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), PolicyId.of(policyId), revision, dittoHeaders); } private  PolicyIdModified(final ThingId thingId,
            final PolicyId policyId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); @Deprecated static PolicyIdModified of(final String thingId,
            final String policyId,
            final long revision,
            final DittoHeaders dittoHeaders); static PolicyIdModified of(final ThingId thingId,
            final PolicyId policyId,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static PolicyIdModified of(final String thingId,
            final String policyId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static PolicyIdModified of(final ThingId thingId,
            final PolicyId policyId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static PolicyIdModified of(final ThingId thingId,
            final PolicyId policyId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); static PolicyIdModified fromJson(final String jsonString, final DittoHeaders dittoHeaders); static PolicyIdModified fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Deprecated String getPolicyId(); PolicyId getPolicyEntityId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override PolicyIdModified setRevision(final long revision); @Override PolicyIdModified 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 tryToCreateInstanceWithNullThingId() { PolicyIdModified.of(null, PolicyId.of(TestConstants.Thing.THING_ID), TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final PolicyIdModified underTest = PolicyIdModified.of(TestConstants.Thing.THING_ID, PolicyId.of(TestConstants.Thing.THING_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); }