DeleteConnection extends AbstractCommand<DeleteConnection> implements ConnectivityModifyCommand<DeleteConnection> { public static DeleteConnection of(final ConnectionId connectionId, final DittoHeaders dittoHeaders) { checkNotNull(connectionId, "Connection ID"); return new DeleteConnection(connectionId, dittoHeaders); } private  DeleteConnection(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static DeleteConnection of(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static DeleteConnection fromJson(final String jsonString, final DittoHeaders dittoHeaders); static DeleteConnection fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ConnectionId getConnectionEntityId(); @Override Category getCategory(); @Override DeleteConnection 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 createInstanceWithNullConnectionId() { assertThatExceptionOfType(NullPointerException.class) .isThrownBy(() -> DeleteConnection.of(null, DittoHeaders.empty())) .withMessage("The %s must not be null!", "Connection ID") .withNoCause(); }
@Test public void toJsonReturnsExpected() { final JsonObject actual = DeleteConnection.of(TestConstants.ID, DittoHeaders.empty()).toJson(); assertThat(actual).isEqualTo(KNOWN_JSON); }
@Test public void getResourcePathReturnsExpected() { final JsonPointer expectedResourcePath = JsonFactory.emptyPointer(); final DeleteConnection underTest = DeleteConnection.of(TestConstants.ID, DittoHeaders.empty()); DittoJsonAssertions.assertThat(underTest.getResourcePath()).isEqualTo(expectedResourcePath); }