DeleteConnectionResponse extends AbstractCommandResponse<DeleteConnectionResponse> implements ConnectivityModifyCommandResponse<DeleteConnectionResponse> { public static DeleteConnectionResponse of(final ConnectionId connectionId, final DittoHeaders dittoHeaders) { checkNotNull(connectionId, "Connection ID"); return new DeleteConnectionResponse(connectionId, dittoHeaders); } private  DeleteConnectionResponse(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static DeleteConnectionResponse of(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static DeleteConnectionResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static DeleteConnectionResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ConnectionId getConnectionEntityId(); @Override JsonPointer getResourcePath(); @Override DeleteConnectionResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test public void createInstanceWithNullConnectionId() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> DeleteConnectionResponse.of(null, DittoHeaders.empty())) .withMessage("The %s must not be null!", "Connection ID") .withNoCause(); }
@Test public void toJsonReturnsExpected() { final JsonObject actual = DeleteConnectionResponse.of(TestConstants.ID, DittoHeaders.empty()).toJson(); assertThat(actual).isEqualTo(KNOWN_JSON); }