RetrieveResourcesResponse extends AbstractCommandResponse<RetrieveResourcesResponse> implements
        PolicyQueryCommandResponse<RetrieveResourcesResponse> { @Deprecated public static RetrieveResourcesResponse of(final String policyId, final Label label, final Resources resources, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), label, resources, dittoHeaders); } private  RetrieveResourcesResponse(final PolicyId policyId,
            final Label label,
            final JsonObject resources,
            final HttpStatusCode statusCode,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveResourcesResponse of(final String policyId,
            final Label label,
            final Resources resources,
            final DittoHeaders dittoHeaders); static RetrieveResourcesResponse of(final PolicyId policyId,
            final Label label,
            final Resources resources,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveResourcesResponse of(final String policyId,
            final Label label,
            final JsonObject resources,
            final DittoHeaders dittoHeaders); static RetrieveResourcesResponse of(final PolicyId policyId,
            final Label label,
            final JsonObject resources,
            final DittoHeaders dittoHeaders); static RetrieveResourcesResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveResourcesResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override PolicyId getEntityId(); Label getLabel(); Resources getResources(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override RetrieveResourcesResponse setEntity(final JsonValue entity); @Override RetrieveResourcesResponse 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 tryToCreateInstanceWithNullResources() { RetrieveResourcesResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, (Resources) null, EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullJsonObject() { RetrieveResourcesResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, (JsonObject) null, EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveResourcesResponse underTest = RetrieveResourcesResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.LABEL, TestConstants.Policy.RESOURCES, EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }