RetrieveAclEntry extends AbstractCommand<RetrieveAclEntry> implements ThingQueryCommand<RetrieveAclEntry> { @Deprecated public static RetrieveAclEntry of(final String thingId, final AuthorizationSubject authorizationSubject, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), authorizationSubject, dittoHeaders); } private  RetrieveAclEntry(final AuthorizationSubject authorizationSubject,
            @Nullable final JsonFieldSelector selectedFields,
            final ThingId thingId,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveAclEntry of(final String thingId, final AuthorizationSubject authorizationSubject,
            final DittoHeaders dittoHeaders); static RetrieveAclEntry of(final ThingId thingId, final AuthorizationSubject authorizationSubject,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveAclEntry of(final String thingId,
            final AuthorizationSubject authorizationSubject,
            @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); static RetrieveAclEntry of(final ThingId thingId,
            final AuthorizationSubject authorizationSubject,
            @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); static RetrieveAclEntry fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveAclEntry fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); AuthorizationSubject getAuthorizationSubject(); @Override Optional<JsonFieldSelector> getSelectedFields(); @Override JsonSchemaVersion[] getSupportedSchemaVersions(); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override RetrieveAclEntry setDittoHeaders(final DittoHeaders dittoHeaders); @Override int hashCode(); @SuppressWarnings("squid:S1067") @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = ThingIdInvalidException.class) public void tryToCreateInstanceWithNullThingIdString() { RetrieveAclEntry.of((String) null, TestConstants.Authorization.AUTH_SUBJECT_OLDMAN, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { RetrieveAclEntry.of((ThingId) null, TestConstants.Authorization.AUTH_SUBJECT_OLDMAN, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullAuthorizationSubject() { RetrieveAclEntry.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveAclEntry underTest = RetrieveAclEntry.of(TestConstants.Thing.THING_ID, TestConstants.Authorization.AUTH_SUBJECT_OLDMAN, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(KNOWN_SCHEMA_VERSION, FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }