IdeaLinksPlugin implements Aggregator { @Override public void aggregate(final Configuration configuration, final List<LaunchResults> launchesResults, final Path outputDirectory) { if (enabled) { launchesResults.stream() .map(LaunchResults::getAllResults) .flatMap(Collection::stream) .forEach(this::addIdeaLink); } } IdeaLinksPlugin();  IdeaLinksPlugin(final boolean enabled, final int port); @Override void aggregate(final Configuration configuration,
                          final List<LaunchResults> launchesResults,
                          final Path outputDirectory);  }
@Test void shouldExportTestResultToJira() { final LaunchResults launchResults = mock(LaunchResults.class); final TestResult testResult = new TestResult() .setLabels(Collections.singletonList(new Label().setName("testClass").setValue(TEST_CLASS))); final Set<TestResult> results = new HashSet<>(Collections.singletonList(testResult)); when(launchResults.getAllResults()).thenReturn(results); final IdeaLinksPlugin jiraTestResultExportPlugin = new IdeaLinksPlugin(true, 63342); jiraTestResultExportPlugin.aggregate( mock(Configuration.class), Collections.singletonList(launchResults), Paths.get("/") ); assertThat(testResult.getLinks()).hasSize(1); final Link link = testResult.getLinks().get(0); assertThat(link.getName()).isEqualTo("Open in Idea"); assertThat(link.getType()).isEqualTo("idea"); assertThat(link.getUrl()).contains(TEST_CLASS.replace(".", "/")); }