DeleteAttribute extends AbstractCommand<DeleteAttribute> implements ThingModifyCommand<DeleteAttribute> { @Deprecated public static DeleteAttribute of(final String thingId, final JsonPointer attributeJsonPointer, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), attributeJsonPointer, dittoHeaders); } private  DeleteAttribute(final ThingId thingId, final JsonPointer attributePointer,
            final DittoHeaders dittoHeaders); @Deprecated static DeleteAttribute of(final String thingId, final JsonPointer attributeJsonPointer,
            final DittoHeaders dittoHeaders); static DeleteAttribute of(final ThingId thingId, final JsonPointer attributeJsonPointer,
            final DittoHeaders dittoHeaders); static DeleteAttribute fromJson(final String jsonString, final DittoHeaders dittoHeaders); static DeleteAttribute fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); JsonPointer getAttributePointer(); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override Category getCategory(); @Override DeleteAttribute 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 = ThingIdInvalidException.class) public void tryToCreateInstanceWithNullThingIdString() { DeleteAttribute.of((String) null, TestConstants.Pointer.VALID_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { DeleteAttribute.of((ThingId) null, TestConstants.Pointer.VALID_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullJsonPointers() { DeleteAttribute.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = JsonKeyInvalidException.class) public void createInstanceWithInvalidArguments() { DeleteAttribute.of(TestConstants.Thing.THING_ID, TestConstants.Pointer.INVALID_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = AttributePointerInvalidException.class) public void createInstanceWithEmptyPointer() { DeleteAttribute.of(TestConstants.Thing.THING_ID, EMPTY_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final DeleteAttribute underTest = DeleteAttribute.of(TestConstants.Thing.THING_ID, TestConstants.Pointer.VALID_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }