PurgeNamespace extends AbstractNamespaceCommand<PurgeNamespace> { public static PurgeNamespace fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return new CommandJsonDeserializer<PurgeNamespace>(TYPE, jsonObject).deserialize(() -> { final String namespace = jsonObject.getValueOrThrow(NamespaceCommand.JsonFields.NAMESPACE); return new PurgeNamespace(namespace, dittoHeaders); }); } private  PurgeNamespace(final CharSequence namespace, final DittoHeaders dittoHeaders); static PurgeNamespace of(final CharSequence namespace, final DittoHeaders dittoHeaders); static PurgeNamespace fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override PurgeNamespace setDittoHeaders(final DittoHeaders dittoHeaders); @Override String toString(); static final String TYPE; }
@Test public void fromJsonReturnsExpected() { final PurgeNamespace commandFromJson = PurgeNamespace.fromJson(knownJsonRepresentation, dittoHeaders); assertThat(commandFromJson).isEqualTo(underTest); }