ModifyFeatureProperty extends AbstractCommand<ModifyFeatureProperty> implements
        ThingModifyCommand<ModifyFeatureProperty>, WithFeatureId { @Deprecated public static ModifyFeatureProperty of(final String thingId, final String featureId, final JsonPointer propertyJsonPointer, final JsonValue propertyValue, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), featureId, propertyJsonPointer, propertyValue, dittoHeaders); } private  ModifyFeatureProperty(final ThingId thingId, final String featureId, final JsonPointer propertyPointer,
            final JsonValue propertyValue, final DittoHeaders dittoHeaders); @Deprecated static ModifyFeatureProperty of(final String thingId, final String featureId,
            final JsonPointer propertyJsonPointer, final JsonValue propertyValue, final DittoHeaders dittoHeaders); static ModifyFeatureProperty of(final ThingId thingId, final String featureId,
            final JsonPointer propertyJsonPointer, final JsonValue propertyValue, final DittoHeaders dittoHeaders); static ModifyFeatureProperty fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ModifyFeatureProperty fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); JsonPointer getPropertyPointer(); JsonValue getPropertyValue(); @Override ThingId getThingEntityId(); @Override String getFeatureId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override ModifyFeatureProperty setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean changesAuthorization(); @Override int hashCode(); @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067", "OverlyComplexMethod"}) @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = ThingIdInvalidException.class) public void tryToCreateInstanceWithNullThingIdString() { ModifyFeatureProperty.of((String) null, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { ModifyFeatureProperty.of((ThingId) null, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullFeatureId() { ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, null, PROPERTY_JSON_POINTER, PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPropertyJsonPointer() { ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, null, PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullPropertyValue() { ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final ModifyFeatureProperty underTest = ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }
@Test public void tryToCreateInstanceWithValidArguments() { ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = JsonKeyInvalidException.class) public void tryToCreateInstanceWithInvalidArguments() { ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, INVALID_JSON_POINTER, PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = JsonKeyInvalidException.class) public void createInstanceFromInvalidJsonValue() { final JsonValue invalid = JsonValue.of(JsonObject.of("{\"bar/baz\":false}")); ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, VALID_JSON_POINTER, invalid, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void tryToCreateInstanceWithValidPropertyJsonObject() { final JsonValue valid = JsonValue.of(JsonObject.of("{\"bar.baz\":false}")); ModifyFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, VALID_JSON_POINTER, valid, TestConstants.EMPTY_DITTO_HEADERS); }