RetrieveSubjectsResponse extends AbstractCommandResponse<RetrieveSubjectsResponse> implements
        PolicyQueryCommandResponse<RetrieveSubjectsResponse> { @Deprecated public static RetrieveSubjectsResponse of(final String policyId, final Label label, final Subjects subjects, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), label, subjects, dittoHeaders); } private  RetrieveSubjectsResponse(final PolicyId policyId,
            final Label label,
            final JsonObject subjects,
            final HttpStatusCode statusCode,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveSubjectsResponse of(final String policyId,
            final Label label,
            final Subjects subjects,
            final DittoHeaders dittoHeaders); static RetrieveSubjectsResponse of(final PolicyId policyId,
            final Label label,
            final Subjects subjects,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveSubjectsResponse of(final String policyId,
            final Label label,
            final JsonObject subjects,
            final DittoHeaders dittoHeaders); static RetrieveSubjectsResponse of(final PolicyId policyId,
            final Label label,
            final JsonObject subjects,
            final DittoHeaders dittoHeaders); static RetrieveSubjectsResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveSubjectsResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override PolicyId getEntityId(); Label getLabel(); Subjects getSubjects(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override RetrieveSubjectsResponse setEntity(final JsonValue entity); @Override RetrieveSubjectsResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override JsonPointer getResourcePath(); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullJsonObject() { RetrieveSubjectsResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, (JsonObject) null, EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullSubjects() { RetrieveSubjectsResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, (Subjects) null, EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveSubjectsResponse underTest = RetrieveSubjectsResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, TestConstants.Policy.SUBJECTS, EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }