RetrievePolicyEntriesResponse extends AbstractCommandResponse<RetrievePolicyEntriesResponse> implements PolicyQueryCommandResponse<RetrievePolicyEntriesResponse> { @Deprecated public static RetrievePolicyEntriesResponse of(final String policyId, final Iterable<PolicyEntry> policyEntries, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), policyEntries, dittoHeaders); } private  RetrievePolicyEntriesResponse(final PolicyId policyId,
            final HttpStatusCode statusCode,
            final JsonObject policyEntries,
            final DittoHeaders dittoHeaders); @Deprecated static RetrievePolicyEntriesResponse of(final String policyId, final Iterable<PolicyEntry> policyEntries,
            final DittoHeaders dittoHeaders); static RetrievePolicyEntriesResponse of(final PolicyId policyId, final Iterable<PolicyEntry> policyEntries,
            final DittoHeaders dittoHeaders); @Deprecated static RetrievePolicyEntriesResponse of(final String policyId, final JsonObject policyEntries,
            final DittoHeaders dittoHeaders); static RetrievePolicyEntriesResponse of(final PolicyId policyId, final JsonObject policyEntries,
            final DittoHeaders dittoHeaders); static RetrievePolicyEntriesResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrievePolicyEntriesResponse fromJson(final JsonObject jsonObject,
            final DittoHeaders dittoHeaders); @Override PolicyId getEntityId(); Iterable<PolicyEntry> getPolicyEntries(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override RetrievePolicyEntriesResponse setEntity(final JsonValue entity); @Override RetrievePolicyEntriesResponse 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 tryToCreateInstanceWithNullPolicyEntries() { RetrievePolicyEntriesResponse.of(TestConstants.Policy.POLICY_ID, (Iterable<PolicyEntry>) null, EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullJsonObject() { RetrievePolicyEntriesResponse.of(TestConstants.Policy.POLICY_ID, (JsonObject) null, EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrievePolicyEntriesResponse underTest = RetrievePolicyEntriesResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.POLICY_ENTRIES, EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }