ModifyPolicyEntries extends AbstractCommand<ModifyPolicyEntries> implements PolicyModifyCommand<ModifyPolicyEntries> { @Deprecated public static ModifyPolicyEntries of(final String policyId, final Iterable<PolicyEntry> policyEntries, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), policyEntries, dittoHeaders); } private  ModifyPolicyEntries(final PolicyId policyId, final Iterable<PolicyEntry> policyEntries,
            final DittoHeaders dittoHeaders); @Deprecated static ModifyPolicyEntries of(final String policyId, final Iterable<PolicyEntry> policyEntries,
            final DittoHeaders dittoHeaders); static ModifyPolicyEntries of(final PolicyId policyId, final Iterable<PolicyEntry> policyEntries,
            final DittoHeaders dittoHeaders); static ModifyPolicyEntries fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyPolicyEntries fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Iterable<PolicyEntry> getPolicyEntries(); @Override PolicyId getEntityId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override ModifyPolicyEntries setDittoHeaders(final DittoHeaders dittoHeaders); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object obj); @SuppressWarnings("squid:S109") @Override int hashCode(); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPolicyId() { ModifyPolicyEntries.of((PolicyId) null, TestConstants.Policy.POLICY_ENTRIES, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = PolicyIdInvalidException.class) public void tryToCreateInstanceWithNullPolicyIdString() { ModifyPolicyEntries.of((String) null, TestConstants.Policy.POLICY_ENTRIES, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void tryToCreateInstanceWithInvalidPolicyId() { assertThatExceptionOfType(PolicyIdInvalidException.class) .isThrownBy(() -> ModifyPolicyEntries.of("undefined", TestConstants.Policy.POLICY_ENTRIES, TestConstants.EMPTY_DITTO_HEADERS)); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPolicyEntries() { ModifyPolicyEntries.of(TestConstants.Policy.POLICY_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }