RetrievePolicyIdResponse extends AbstractCommandResponse<RetrievePolicyIdResponse> implements
        ThingQueryCommandResponse<RetrievePolicyIdResponse> { @Deprecated public static RetrievePolicyIdResponse of(final String thingId, final String policyId, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), PolicyId.of(policyId), dittoHeaders); } private  RetrievePolicyIdResponse(final ThingId thingId, final HttpStatusCode statusCode,
            final PolicyId policyId, final DittoHeaders dittoHeaders); @Deprecated static RetrievePolicyIdResponse of(final String thingId, final String policyId,
            final DittoHeaders dittoHeaders); static RetrievePolicyIdResponse of(final ThingId thingId, final PolicyId policyId,
            final DittoHeaders dittoHeaders); static RetrievePolicyIdResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrievePolicyIdResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override JsonSchemaVersion[] getSupportedSchemaVersions(); @Override ThingId getThingEntityId(); @Deprecated String getPolicyId(); PolicyId getPolicyEntityId(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override RetrievePolicyIdResponse setEntity(final JsonValue entity); @Override RetrievePolicyIdResponse 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 tryToCreateInstanceWithNullPolicyId() { RetrievePolicyIdResponse.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrievePolicyIdResponse underTest = RetrievePolicyIdResponse.of(TestConstants.Thing.THING_ID, TestConstants.Thing.POLICY_ID, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }