PolicyEntriesModified extends AbstractPolicyEvent<PolicyEntriesModified> implements
        PolicyEvent<PolicyEntriesModified> { @Deprecated public static PolicyEntriesModified of(final String policyId, final Iterable<PolicyEntry> policyEntries, final long revision, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), policyEntries, revision, dittoHeaders); } private  PolicyEntriesModified(final PolicyId policyId,
            final Iterable<PolicyEntry> policyEntries,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static PolicyEntriesModified of(final String policyId,
            final Iterable<PolicyEntry> policyEntries,
            final long revision,
            final DittoHeaders dittoHeaders); static PolicyEntriesModified of(final PolicyId policyId,
            final Iterable<PolicyEntry> policyEntries,
            final long revision,
            final DittoHeaders dittoHeaders); @Deprecated static PolicyEntriesModified of(final String policyId,
            final Iterable<PolicyEntry> policyEntries,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static PolicyEntriesModified of(final PolicyId policyId,
            final Iterable<PolicyEntry> policyEntries,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static PolicyEntriesModified fromJson(final String jsonString, final DittoHeaders dittoHeaders); static PolicyEntriesModified fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Iterable<PolicyEntry> getPolicyEntries(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override PolicyEntriesModified setRevision(final long revision); @Override PolicyEntriesModified setDittoHeaders(final DittoHeaders dittoHeaders); @SuppressWarnings("squid:S109") @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object o); @Override String toString(); static final String NAME; static final String TYPE; static final JsonFieldDefinition<JsonObject> JSON_POLICY_ENTRIES; }
@Test(expected = PolicyIdInvalidException.class) public void tryToCreateInstanceWithNullPolicyIdString() { PolicyEntriesModified.of((String) null, TestConstants.Policy.POLICY_ENTRIES, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPolicyId() { PolicyEntriesModified.of((PolicyId) null, TestConstants.Policy.POLICY_ENTRIES, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPolicyEntries() { PolicyEntriesModified.of(TestConstants.Policy.POLICY_ID, null, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final PolicyEntriesModified underTest = PolicyEntriesModified.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.POLICY_ENTRIES, TestConstants.Policy.REVISION_NUMBER, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualToIgnoringFieldDefinitions(KNOWN_JSON); }