@Test public void remoteCallBackSortedIgnoreCase(){ RemoteCallback<List<String>> remoteCallBack = scenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImplSpy.getRemoteCallback(assetConsumer); List<String> dmnFiles = Arrays.asList("AS", "Ap"); remoteCallBack.callback(dmnFiles); verify(assetConsumer, times(1)).accept(dropDownListCaptor.capture()); Collections.sort(dmnFiles, String::compareToIgnoreCase); assertEquals(dmnFiles, dropDownListCaptor.getValue().stream().map(KieAssetsDropdownItem::getValue).collect(Collectors.toList())); }
protected RemoteCallback<List<String>> getRemoteCallback(Consumer<List<KieAssetsDropdownItem>> assetListConsumer) { return response -> { List<KieAssetsDropdownItem> toAccept = response.stream() .map(this::getKieAssetsDropdownItem) .sorted(Comparator.comparing(KieAssetsDropdownItem::getText, String.CASE_INSENSITIVE_ORDER)) .collect(Collectors.toList()); assetListConsumer.accept(toAccept); }; }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected RemoteCallback<List<String>> getRemoteCallback(Consumer<List<KieAssetsDropdownItem>> assetListConsumer) { return response -> { List<KieAssetsDropdownItem> toAccept = response.stream() .map(this::getKieAssetsDropdownItem) .sorted(Comparator.comparing(KieAssetsDropdownItem::getText, String.CASE_INSENSITIVE_ORDER)) .collect(Collectors.toList()); assetListConsumer.accept(toAccept); }; } }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected RemoteCallback<List<String>> getRemoteCallback(Consumer<List<KieAssetsDropdownItem>> assetListConsumer) { return response -> { List<KieAssetsDropdownItem> toAccept = response.stream() .map(this::getKieAssetsDropdownItem) .sorted(Comparator.comparing(KieAssetsDropdownItem::getText, String.CASE_INSENSITIVE_ORDER)) .collect(Collectors.toList()); assetListConsumer.accept(toAccept); }; }  }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected RemoteCallback<List<String>> getRemoteCallback(Consumer<List<KieAssetsDropdownItem>> assetListConsumer) { return response -> { List<KieAssetsDropdownItem> toAccept = response.stream() .map(this::getKieAssetsDropdownItem) .sorted(Comparator.comparing(KieAssetsDropdownItem::getText, String.CASE_INSENSITIVE_ORDER)) .collect(Collectors.toList()); assetListConsumer.accept(toAccept); }; }  @Override void getItems(Consumer<List<KieAssetsDropdownItem>> assetListConsumer); }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected RemoteCallback<List<String>> getRemoteCallback(Consumer<List<KieAssetsDropdownItem>> assetListConsumer) { return response -> { List<KieAssetsDropdownItem> toAccept = response.stream() .map(this::getKieAssetsDropdownItem) .sorted(Comparator.comparing(KieAssetsDropdownItem::getText, String.CASE_INSENSITIVE_ORDER)) .collect(Collectors.toList()); assetListConsumer.accept(toAccept); }; }  @Override void getItems(Consumer<List<KieAssetsDropdownItem>> assetListConsumer);  }