SuiteRunIndexWrapper extends RunIndexWrapper<Suite> { @Override public List<UrlPacket> getUrlPackets() { Suite suite = objectToRunWrapper.getObjectToRun(); List<UrlPacket> packets = new ArrayList<>(); for (Test test : suite.getTests()) { UrlPacket packet = new UrlPacket(suite, test); for (Url url : test.getUrls()) { cleanUrlFromExecutionData(url); packet.addUrl(url); } packets.add(packet); } return packets; } SuiteRunIndexWrapper(Run<Suite> objectToRunWrapper); @Override List<UrlPacket> getUrlPackets(); @Override int countUrls();  }
@Test public void getUrlPackets_expectZero() { prepareZeroUrls(); List<UrlPacket> packets = suiteRunIndexWrapper.getUrlPackets(); Long urlsCount = packets.stream().map(UrlPacket::getUrls).mapToLong(List::size).sum(); assertThat(urlsCount, is(0L)); }
@Test public void getUrlPackets_expectThree() { prepareThreeUrls(); List<UrlPacket> packets = suiteRunIndexWrapper.getUrlPackets(); Long urlsCount = packets.stream().map(UrlPacket::getUrls).mapToLong(List::size).sum(); assertThat(urlsCount, is(3L)); }