AclEntryModified extends AbstractThingEvent<AclEntryModified> implements ThingModifiedEvent<AclEntryModified> { @Deprecated public static AclEntryModified of(final String thingId, final AclEntry aclEntry, final long revision, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), aclEntry, revision, dittoHeaders); } private  AclEntryModified(final ThingId thingId,
            final AclEntry aclEntry,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); @Deprecated static AclEntryModified of(final String thingId,
            final AclEntry aclEntry,
            final long revision,
            final DittoHeaders dittoHeaders); static AclEntryModified of(final ThingId thingId,
            final AclEntry aclEntry,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static AclEntryModified of(final String thingId,
            final AclEntry aclEntry,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static AclEntryModified of(final ThingId thingId,
            final AclEntry aclEntry,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static AclEntryModified of(final ThingId thingId,
            final AclEntry aclEntry,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders,
            @Nullable final Metadata metadata); static AclEntryModified fromJson(final String jsonString, final DittoHeaders dittoHeaders); static AclEntryModified fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); AclEntry getAclEntry(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override AclEntryModified setRevision(final long revision); @Override AclEntryModified 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() { AclEntryModified.of((String) null, TestConstants.Authorization.ACL_ENTRY_OLDMAN, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { AclEntryModified.of((ThingId) null, TestConstants.Authorization.ACL_ENTRY_OLDMAN, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullAcl() { AclEntryModified.of(TestConstants.Thing.THING_ID, null, TestConstants.Thing.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final AclEntryModified underTest = AclEntryModified.of(TestConstants.Thing.THING_ID, TestConstants.Authorization.ACL_ENTRY_OLDMAN, 2, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS, TestConstants.METADATA); final JsonObject actualJson = underTest.toJson(JsonSchemaVersion.V_1, FieldType.regularOrSpecial()); assertThat(actualJson).isEqualToIgnoringFieldDefinitions(KNOWN_JSON .remove(Event.JsonFields.ID.getPointer()) .set(Event.JsonFields.TYPE, AclEntryModified.TYPE)); }