ConnectionOpened extends AbstractConnectivityEvent<ConnectionOpened> implements ConnectivityEvent<ConnectionOpened> { @Deprecated public static ConnectionOpened of(final String connectionId, final DittoHeaders dittoHeaders) { return of(ConnectionId.of(connectionId), dittoHeaders); } private  ConnectionOpened(final ConnectionId connectionId, @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); @Deprecated static ConnectionOpened of(final String connectionId, final DittoHeaders dittoHeaders); static ConnectionOpened of(final ConnectionId connectionId, final DittoHeaders dittoHeaders); @Deprecated static ConnectionOpened of(final String connectionId, @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static ConnectionOpened of(final ConnectionId connectionId, @Nullable final Instant timestamp,
            final DittoHeaders dittoHeaders); static ConnectionOpened fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ConnectionOpened fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override JsonPointer getResourcePath(); @Override ConnectionOpened setDittoHeaders(final DittoHeaders dittoHeaders); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void createInstanceWithNullConnectionIdString() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> ConnectionOpened.of((String) null, DittoHeaders.empty())) .withMessage("The entityId must not be null!") .withNoCause(); }
@Test public void createInstanceWithNullConnectionId() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> ConnectionOpened.of((ConnectionId) null, DittoHeaders.empty())) .withMessage("The %s must not be null!", "Connection ID") .withNoCause(); }
@Test public void toJsonReturnsExpected() { final JsonObject actual = ConnectionOpened.of(TestConstants.ID, DittoHeaders.empty()).toJson(); assertThat(actual).isEqualTo(KNOWN_JSON); }