RetrieveThingDefinition extends AbstractCommand<RetrieveThingDefinition> implements ThingQueryCommand<RetrieveThingDefinition> { public static RetrieveThingDefinition of(final ThingId thingId, final DittoHeaders dittoHeaders) { return new RetrieveThingDefinition(thingId, dittoHeaders); } private  RetrieveThingDefinition(final ThingId thingId, final DittoHeaders dittoHeaders); static RetrieveThingDefinition of(final ThingId thingId, final DittoHeaders dittoHeaders); static RetrieveThingDefinition fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveThingDefinition fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override JsonSchemaVersion[] getSupportedSchemaVersions(); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override RetrieveThingDefinition 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 = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { RetrieveThingDefinition.of(null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveThingDefinition underTest = RetrieveThingDefinition.of(TestConstants.Thing.THING_ID, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(KNOWN_SCHEMA_VERSION, FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }