PolicyDeleted extends AbstractPolicyEvent<PolicyDeleted> implements PolicyEvent<PolicyDeleted> { @Deprecated public static PolicyDeleted of(final String policyId, final long revision, final DittoHeaders dittoHeaders) { return of(PolicyId.of(policyId), revision, dittoHeaders); } private  PolicyDeleted(final PolicyId policyId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static PolicyDeleted of(final String policyId, final long revision, final DittoHeaders dittoHeaders); static PolicyDeleted of(final PolicyId policyId, final long revision, final DittoHeaders dittoHeaders); @Deprecated static PolicyDeleted of(final String policyId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static PolicyDeleted of(final PolicyId policyId,
            final long revision,
            @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static PolicyDeleted fromJson(final String jsonString, final DittoHeaders dittoHeaders); static PolicyDeleted fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override JsonPointer getResourcePath(); @Override PolicyDeleted setRevision(final long revision); @Override PolicyDeleted setDittoHeaders(final DittoHeaders dittoHeaders); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = PolicyIdInvalidException.class) public void tryToCreateInstanceWithNullPolicyIdString() { PolicyDeleted.of((String) null, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPolicyId() { PolicyDeleted.of((PolicyId) null, TestConstants.Policy.REVISION_NUMBER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullDittoHeaders() { PolicyDeleted.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.REVISION_NUMBER, null); }
@Test public void toJsonReturnsExpected() { final PolicyDeleted underTest = PolicyDeleted.of(TestConstants.Policy.POLICY_ID, TestConstants.Policy.REVISION_NUMBER, TestConstants.TIMESTAMP, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }