ModifyFeature extends AbstractCommand<ModifyFeature> implements ThingModifyCommand<ModifyFeature>,
        WithFeatureId { @Deprecated public static ModifyFeature of(final String thingId, final Feature feature, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), feature, dittoHeaders); } private  ModifyFeature(final ThingId thingId, final Feature feature, final DittoHeaders dittoHeaders); @Deprecated static ModifyFeature of(final String thingId, final Feature feature, final DittoHeaders dittoHeaders); static ModifyFeature of(final ThingId thingId, final Feature feature, final DittoHeaders dittoHeaders); static ModifyFeature fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyFeature fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Feature getFeature(); @Override ThingId getThingEntityId(); @Override String getFeatureId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override ModifyFeature 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 tryToCreateInstanceWithNullFeature() { ModifyFeature.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final ModifyFeature underTest = ModifyFeature.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }