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