Shutdown extends CommonCommand<Shutdown> { public static Shutdown fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return new CommandJsonDeserializer<Shutdown>(TYPE, jsonObject).deserialize( () -> getInstance(ShutdownReasonFactory.fromJson( jsonObject.getValue(JsonFields.REASON).orElseGet(JsonObject::empty)), dittoHeaders)); } private  Shutdown(final ShutdownReason theReason, final DittoHeaders dittoHeaders); static Shutdown getInstance(final ShutdownReason shutdownReason, final DittoHeaders dittoHeaders); static Shutdown fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); ShutdownReason getReason(); @Override Shutdown setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test public void fromJsonWorksAsExpected() { assertThat(Shutdown.fromJson(knownJsonRepresentation, dittoHeaders)).isEqualTo(underTest); }