ModifyFeatures extends AbstractCommand<ModifyFeatures> implements ThingModifyCommand<ModifyFeatures> { @Deprecated public static ModifyFeatures of(final String thingId, final Features features, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), features, dittoHeaders); } private  ModifyFeatures(final ThingId thingId, final Features features, final DittoHeaders dittoHeaders); @Deprecated static ModifyFeatures of(final String thingId, final Features features, final DittoHeaders dittoHeaders); static ModifyFeatures of(final ThingId thingId, final Features features, final DittoHeaders dittoHeaders); static ModifyFeatures fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyFeatures fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Features getFeatures(); @Override ThingId getThingEntityId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override ModifyFeatures setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean changesAuthorization(); @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullFeatures() { ModifyFeatures.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final ModifyFeatures underTest = ModifyFeatures.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FEATURES, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }