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