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