ModifyPolicyResponse extends AbstractCommandResponse<ModifyPolicyResponse> implements PolicyModifyCommandResponse<ModifyPolicyResponse> { @Deprecated public static ModifyPolicyResponse created(final String policyId, final Policy policy, final DittoHeaders dittoHeaders) { return created(PolicyId.of(policyId), policy, dittoHeaders); } private  ModifyPolicyResponse(final PolicyId policyId,
            final HttpStatusCode statusCode,
            @Nullable final Policy policyCreated,
            final DittoHeaders dittoHeaders); @Deprecated static ModifyPolicyResponse created(final String policyId, final Policy policy,
            final DittoHeaders dittoHeaders); static ModifyPolicyResponse created(final PolicyId policyId, final Policy policy,
            final DittoHeaders dittoHeaders); @Deprecated static ModifyPolicyResponse modified(final String policyId, final DittoHeaders dittoHeaders); static ModifyPolicyResponse modified(final PolicyId policyId, final DittoHeaders dittoHeaders); static ModifyPolicyResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyPolicyResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override PolicyId getEntityId(); Optional<Policy> getPolicyCreated(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override ModifyPolicyResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test public void parseModifyPolicyCommandResponse() { final ModifyPolicyResponse commandResponse = ModifyPolicyResponse.created(TestConstants.Policy.POLICY_ID, TestConstants.Policy.POLICY, TestConstants.DITTO_HEADERS); final JsonObject jsonObject = commandResponse.toJson(FieldType.regularOrSpecial()); final CommandResponse parsedCommandResponse = GlobalCommandResponseRegistry.getInstance().parse(jsonObject, TestConstants.DITTO_HEADERS); assertThat(parsedCommandResponse).isEqualTo(commandResponse); }