@Test void createForm() { final Supplier<Ui> form = new UiSpecMapperImpl(new UiSpecMapperImpl.Configuration(singletonList(new TitleMapProvider() { private int it = 0; @Override public String reference() { return "vendors"; } @Override public Collection<UiSchema.NameValue> get() { return asList(new UiSchema.NameValue.Builder().withName("k" + ++it).withValue("v" + it).build(), new UiSchema.NameValue.Builder().withName("k" + ++it).withValue("v" + it).build()); } }))).createFormFor(ComponentModel.class); IntStream.of(1, 2).forEach(it -> { try (final Jsonb jsonb = JsonbBuilder .create(new JsonbConfig() .withFormatting(true) .withPropertyOrderStrategy(PropertyOrderStrategy.LEXICOGRAPHICAL)); final BufferedReader reader = new BufferedReader(new InputStreamReader( Thread .currentThread() .getContextClassLoader() .getResourceAsStream("component-model-" + it + ".json"), StandardCharsets.UTF_8))) { assertEquals(reader.lines().collect(joining("\n")), jsonb.toJson(form.get())); } catch (final Exception e) { throw new IllegalStateException(e); } }); }
@Override public Supplier<Ui> createFormFor(final Class<?> clazz) { return doCreateForm(clazz); }
UiSpecMapperImpl implements UiSpecMapper { @Override public Supplier<Ui> createFormFor(final Class<?> clazz) { return doCreateForm(clazz); } }
UiSpecMapperImpl implements UiSpecMapper { @Override public Supplier<Ui> createFormFor(final Class<?> clazz) { return doCreateForm(clazz); }  }
UiSpecMapperImpl implements UiSpecMapper { @Override public Supplier<Ui> createFormFor(final Class<?> clazz) { return doCreateForm(clazz); }  @Override Supplier<Ui> createFormFor(final Class<?> clazz); }
UiSpecMapperImpl implements UiSpecMapper { @Override public Supplier<Ui> createFormFor(final Class<?> clazz) { return doCreateForm(clazz); }  @Override Supplier<Ui> createFormFor(final Class<?> clazz);  }