RetrievePolicyEntryResponse extends AbstractCommandResponse<RetrievePolicyEntryResponse> implements PolicyQueryCommandResponse<RetrievePolicyEntryResponse> { @Deprecated public static RetrievePolicyEntryResponse of(final String policyId, final PolicyEntry policyEntry, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), policyEntry, dittoHeaders); } private  RetrievePolicyEntryResponse(final PolicyId policyId,
            final HttpStatusCode statusCode,
            final String policyEntryLabel,
            final JsonObject policyEntry,
            final DittoHeaders dittoHeaders); @Deprecated static RetrievePolicyEntryResponse of(final String policyId, final PolicyEntry policyEntry,
            final DittoHeaders dittoHeaders); static RetrievePolicyEntryResponse of(final PolicyId policyId, final PolicyEntry policyEntry,
            final DittoHeaders dittoHeaders); @Deprecated static RetrievePolicyEntryResponse of(final String policyId,
            final String policyEntryLabel,
            final JsonObject policyEntry,
            final DittoHeaders dittoHeaders); static RetrievePolicyEntryResponse of(final PolicyId policyId,
            final String policyEntryLabel,
            final JsonObject policyEntry,
            final DittoHeaders dittoHeaders); static RetrievePolicyEntryResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrievePolicyEntryResponse fromJson(final JsonObject jsonObject,
            final DittoHeaders dittoHeaders); @Override PolicyId getEntityId(); PolicyEntry getPolicyEntry(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override RetrievePolicyEntryResponse setEntity(final JsonValue entity); @Override RetrievePolicyEntryResponse 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 tryToCreateInstanceWithNullPolicyEntry() { RetrievePolicyEntryResponse.of(TestConstants.Policy.POLICY_ID, null, EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullJsonObject() { RetrievePolicyEntryResponse.of(TestConstants.Policy.POLICY_ID, "LABEL", null, EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullLabel() { RetrievePolicyEntryResponse.of(TestConstants.Policy.POLICY_ID, null, JsonFactory.newObjectBuilder().build(), EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrievePolicyEntryResponse underTest = RetrievePolicyEntryResponse.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.POLICY_ENTRY, EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }