ModifyConnectionResponse extends AbstractCommandResponse<ModifyConnectionResponse> implements ConnectivityModifyCommandResponse<ModifyConnectionResponse> { public static ModifyConnectionResponse of(final ConnectionId connectionId, final DittoHeaders dittoHeaders) { return new ModifyConnectionResponse(connectionId, dittoHeaders); } private  ModifyConnectionResponse(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static ModifyConnectionResponse of(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static ModifyConnectionResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyConnectionResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ConnectionId getConnectionEntityId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override ModifyConnectionResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test public void toJsonReturnsExpected() { final JsonObject actual = ModifyConnectionResponse.of(TestConstants.CONNECTION.getId(), DittoHeaders.empty()).toJson(); assertThat(actual).isEqualTo(KNOWN_JSON); }
@Test public void getResourcePathReturnsExpected() { final JsonPointer expectedResourcePath = JsonFactory.emptyPointer(); final ModifyConnectionResponse underTest = ModifyConnectionResponse.of(TestConstants.CONNECTION.getId(), DittoHeaders.empty()); DittoJsonAssertions.assertThat(underTest.getResourcePath()).isEqualTo(expectedResourcePath); }