RetrieveAttribute extends AbstractCommand<RetrieveAttribute> implements ThingQueryCommand<RetrieveAttribute> { @Deprecated public static RetrieveAttribute of(final String thingId, final JsonPointer attributeJsonPointer, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), attributeJsonPointer, dittoHeaders); } private  RetrieveAttribute(final JsonPointer attributePointer, final ThingId thingId,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveAttribute of(final String thingId, final JsonPointer attributeJsonPointer,
            final DittoHeaders dittoHeaders); static RetrieveAttribute of(final ThingId thingId, final JsonPointer attributeJsonPointer,
            final DittoHeaders dittoHeaders); static RetrieveAttribute fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveAttribute fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); JsonPointer getAttributePointer(); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override RetrieveAttribute setDittoHeaders(final DittoHeaders dittoHeaders); @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() { RetrieveAttribute.of((String) null, KNOWN_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { RetrieveAttribute.of((ThingId) null, KNOWN_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullJsonPointer() { RetrieveAttribute.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void tryToCreateInstanceWithValidArguments() { RetrieveAttribute.of(TestConstants.Thing.THING_ID, KNOWN_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveAttribute underTest = RetrieveAttribute.of(TestConstants.Thing.THING_ID, KNOWN_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }
@Test(expected = JsonKeyInvalidException.class) public void createInstanceFromInvalidArguments() { RetrieveAttribute.of(TestConstants.Thing.THING_ID, INVALID_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }