@Test public void testBuildOptions() { doReturn(new KieSelectOption("A", "a")).when(kieEnumSelectElement).newOption(any()); final List<KieSelectOption> options = kieEnumSelectElement.buildOptions(TestEnum.values()); assertEquals(2, options.size()); assertEquals("A", options.get(0).label); assertEquals("a", options.get(0).value); assertEquals("A", options.get(1).label); assertEquals("a", options.get(1).value); }
List<KieSelectOption> buildOptions(final T[] values) { return Arrays.stream(values).map(this::newOption).collect(toList()); }
KieEnumSelectElement implements IsElement { List<KieSelectOption> buildOptions(final T[] values) { return Arrays.stream(values).map(this::newOption).collect(toList()); } }
KieEnumSelectElement implements IsElement { List<KieSelectOption> buildOptions(final T[] values) { return Arrays.stream(values).map(this::newOption).collect(toList()); } @Inject  KieEnumSelectElement(final View view,
                                final KieSelectElement kieSelectElement,
                                final TranslationService translationService); }
KieEnumSelectElement implements IsElement { List<KieSelectOption> buildOptions(final T[] values) { return Arrays.stream(values).map(this::newOption).collect(toList()); } @Inject  KieEnumSelectElement(final View view,
                                final KieSelectElement kieSelectElement,
                                final TranslationService translationService); @PostConstruct void init(); @SuppressWarnings("unchecked") void setup(final T[] values,
                      final T initialValue,
                      final Consumer<T> onChange); T getValue(); @Override HTMLElement getElement(); }
KieEnumSelectElement implements IsElement { List<KieSelectOption> buildOptions(final T[] values) { return Arrays.stream(values).map(this::newOption).collect(toList()); } @Inject  KieEnumSelectElement(final View view,
                                final KieSelectElement kieSelectElement,
                                final TranslationService translationService); @PostConstruct void init(); @SuppressWarnings("unchecked") void setup(final T[] values,
                      final T initialValue,
                      final Consumer<T> onChange); T getValue(); @Override HTMLElement getElement();  }