when(fetcherRegistry.getSelectedFetcherIndex(HostnameFetcher.ID)).thenReturn(1);
when(fetcherRegistry.getSelectedFetcherIndex(PingFetcher.ID)).thenReturn(2);
when(fetcherRegistry.getSelectedFetcherIndex("fetcher.comment")).thenReturn(3);
when(fetcherRegistry.getSelectedFetcherIndex("noSuchFetcher")).thenReturn(-1);
ScanningResultList scanningResults = new ScanningResultList(fetcherRegistry);
scanningResults.initNewScan(mockFeeder("info"));
ScanningResult result = scanningResults.createResult(InetAddress.getByName("127.0.0.1"));
result.setValue(0, new InetAddressHolder(InetAddress.getByName("127.0.0.1")));
result.setValue(1, "HOSTNAME");
result.setValue(2, new IntegerWithUnit(10, "ms"));
scanningResults.registerAtIndex(0, result);
OpenerLauncher ol = new OpenerLauncher(fetcherRegistry, scanningResults);
assertEquals("\\\\127.0.0.1", ol.prepareOpenerStringForItem("\\\\${fetcher.ip}", 0));
assertEquals("HOSTNAME$$$127.0.0.1xxx${}", ol.prepareOpenerStringForItem("${fetcher.hostname}$$$${fetcher.ip}xxx${}", 0));