ModifyAclEntry extends AbstractCommand<ModifyAclEntry> implements ThingModifyCommand<ModifyAclEntry> { @Deprecated public static ModifyAclEntry of(final String thingId, final AclEntry aclEntry, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), aclEntry, dittoHeaders); } private  ModifyAclEntry(final ThingId thingId, final AclEntry aclEntry, final DittoHeaders dittoHeaders); @Deprecated static ModifyAclEntry of(final String thingId, final AclEntry aclEntry,
            final DittoHeaders dittoHeaders); static ModifyAclEntry of(final ThingId thingId, final AclEntry aclEntry,
            final DittoHeaders dittoHeaders); static ModifyAclEntry fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyAclEntry fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); AclEntry getAclEntry(); @Override ThingId getThingEntityId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override ModifyAclEntry setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean changesAuthorization(); @Override int hashCode(); @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067", "OverlyComplexMethod"}) @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPermissions() { ModifyAclEntry.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullSubject() { ModifyAclEntry.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void jsonSerializationWorksAsExpected() { final ModifyAclEntry underTest = ModifyAclEntry.of(TestConstants.Thing.THING_ID, TestConstants.Authorization.ACL_ENTRY_GRIMES, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(JsonSchemaVersion.V_1, FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }