@Test public void getKieAssetsDropdownItemFileWithPathWindows() { String path = "path\\"; String fileName = "filename.etc"; String fullPath = path + fileName; KieAssetsDropdownItem item = scenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImplSpy.getKieAssetsDropdownItem(fullPath); assertNotNull(item); assertEquals(fullPath, item.getValue()); assertEquals(fullPath, item.getSubText()); assertEquals(fileName, item.getText()); }
protected KieAssetsDropdownItem getKieAssetsDropdownItem(final String fullPath) { int idx = fullPath.replaceAll("\\\\", "/").lastIndexOf('/'); final String fileName = idx >= 0 ? fullPath.substring(idx + 1) : fullPath; return new KieAssetsDropdownItem(fileName, fullPath, fullPath, new HashMap<>()); }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected KieAssetsDropdownItem getKieAssetsDropdownItem(final String fullPath) { int idx = fullPath.replaceAll("\\\\", "/").lastIndexOf('/'); final String fileName = idx >= 0 ? fullPath.substring(idx + 1) : fullPath; return new KieAssetsDropdownItem(fileName, fullPath, fullPath, new HashMap<>()); } }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected KieAssetsDropdownItem getKieAssetsDropdownItem(final String fullPath) { int idx = fullPath.replaceAll("\\\\", "/").lastIndexOf('/'); final String fileName = idx >= 0 ? fullPath.substring(idx + 1) : fullPath; return new KieAssetsDropdownItem(fileName, fullPath, fullPath, new HashMap<>()); }  }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected KieAssetsDropdownItem getKieAssetsDropdownItem(final String fullPath) { int idx = fullPath.replaceAll("\\\\", "/").lastIndexOf('/'); final String fileName = idx >= 0 ? fullPath.substring(idx + 1) : fullPath; return new KieAssetsDropdownItem(fileName, fullPath, fullPath, new HashMap<>()); }  @Override void getItems(Consumer<List<KieAssetsDropdownItem>> assetListConsumer); }
ScenarioSimulationKogitoRuntimeCreationAssetsDropdownProviderImpl implements ScenarioSimulationKogitoCreationAssetsDropdownProvider { protected KieAssetsDropdownItem getKieAssetsDropdownItem(final String fullPath) { int idx = fullPath.replaceAll("\\\\", "/").lastIndexOf('/'); final String fileName = idx >= 0 ? fullPath.substring(idx + 1) : fullPath; return new KieAssetsDropdownItem(fileName, fullPath, fullPath, new HashMap<>()); }  @Override void getItems(Consumer<List<KieAssetsDropdownItem>> assetListConsumer);  }