RetrieveConnectionMetrics extends AbstractCommand<RetrieveConnectionMetrics> implements ConnectivityQueryCommand<RetrieveConnectionMetrics> { public static RetrieveConnectionMetrics of(final ConnectionId connectionId, final DittoHeaders dittoHeaders) { checkNotNull(connectionId, "Connection ID"); return new RetrieveConnectionMetrics(connectionId, dittoHeaders); } private  RetrieveConnectionMetrics(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static RetrieveConnectionMetrics of(final ConnectionId connectionId, final DittoHeaders dittoHeaders); static RetrieveConnectionMetrics fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveConnectionMetrics fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ConnectionId getConnectionEntityId(); @Override Category getCategory(); @Override JsonPointer getResourcePath(); @Override RetrieveConnectionMetrics setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void toJsonReturnsExpected() { final JsonObject actual = RetrieveConnectionMetrics.of(TestConstants.ID, DittoHeaders.empty()).toJson(); assertThat(actual).isEqualTo(KNOWN_JSON); }