ConnectionCreated extends AbstractConnectivityEvent<ConnectionCreated> implements ConnectivityEvent<ConnectionCreated> { public static ConnectionCreated of(final Connection connection, final DittoHeaders dittoHeaders) { return of(connection,null, dittoHeaders); } private  ConnectionCreated(final Connection connection, @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static ConnectionCreated of(final Connection connection, final DittoHeaders dittoHeaders); static ConnectionCreated of(final Connection connection, @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static ConnectionCreated fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ConnectionCreated fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Connection getConnection(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override ConnectionCreated setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void createInstanceWithNullConnection() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> ConnectionCreated.of(null, null, DittoHeaders.empty())) .withMessage("The %s must not be null!", "Connection") .withNoCause(); }
@Test public void toJsonReturnsExpected() { final JsonObject actual = ConnectionCreated.of(TestConstants.CONNECTION, null, DittoHeaders.empty()).toJson(); assertThat(actual).isEqualTo(KNOWN_JSON); }