ModifyPolicyId extends AbstractCommand<ModifyPolicyId> implements ThingModifyCommand<ModifyPolicyId> { @Deprecated public static ModifyPolicyId of(final String thingId, final String policyId, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), PolicyId.of(policyId), dittoHeaders); } private  ModifyPolicyId(final ThingId thingId, final PolicyId policyId, final DittoHeaders dittoHeaders); @Override JsonSchemaVersion[] getSupportedSchemaVersions(); @Deprecated static ModifyPolicyId of(final String thingId, final String policyId, final DittoHeaders dittoHeaders); static ModifyPolicyId of(final ThingId thingId, final PolicyId policyId,
            final DittoHeaders dittoHeaders); static ModifyPolicyId fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyPolicyId fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Deprecated String getPolicyId(); PolicyId getPolicyEntityId(); @Override ThingId getThingEntityId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override ModifyPolicyId setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean changesAuthorization(); @Override int hashCode(); @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067", "OverlyComplexMethod"}) @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@SuppressWarnings("ConstantConditions") @Test public void tryToCreateInstanceWithNullPolicyId() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> ModifyPolicyId.of(TestConstants.Thing.THING_ID, null, DittoHeaders.empty())) .withNoCause(); }
@Test public void toJsonReturnsExpected() { final ModifyPolicyId underTest = ModifyPolicyId.of(TestConstants.Thing.THING_ID, KNOWN_POLICY_ID, DittoHeaders.empty()); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }