@Test void shouldMergeNumberOfNewIssues() { AnalysisBuildResult first = createAnalysisBuildResultWithNew(0, 5, 2, 6); AnalysisBuildResult second = createAnalysisBuildResultWithNew(0, 4, 2, 7); CompositeBuildResult run = new CompositeBuildResult(); assertThat(run).hasNewSize(0); assertThat(run.add(first)).hasNewSize(13); assertThat(run.add(second)).hasNewSize(26); }
public CompositeBuildResult add(final AnalysisBuildResult... additionalResults) { for (AnalysisBuildResult another : additionalResults) { sizesPerOrigin.putAll(another.getSizePerOrigin()); for (Severity severity : Severity.getPredefinedValues()) { sizesPerSeverity.merge(severity, another.getTotalSizeOf(severity), Integer::sum); newSizesPerSeverity.merge(severity, another.getNewSizeOf(severity), Integer::sum); } fixedSize += another.getFixedSize(); } return this; }
CompositeBuildResult implements AnalysisBuildResult { public CompositeBuildResult add(final AnalysisBuildResult... additionalResults) { for (AnalysisBuildResult another : additionalResults) { sizesPerOrigin.putAll(another.getSizePerOrigin()); for (Severity severity : Severity.getPredefinedValues()) { sizesPerSeverity.merge(severity, another.getTotalSizeOf(severity), Integer::sum); newSizesPerSeverity.merge(severity, another.getNewSizeOf(severity), Integer::sum); } fixedSize += another.getFixedSize(); } return this; } }
CompositeBuildResult implements AnalysisBuildResult { public CompositeBuildResult add(final AnalysisBuildResult... additionalResults) { for (AnalysisBuildResult another : additionalResults) { sizesPerOrigin.putAll(another.getSizePerOrigin()); for (Severity severity : Severity.getPredefinedValues()) { sizesPerSeverity.merge(severity, another.getTotalSizeOf(severity), Integer::sum); newSizesPerSeverity.merge(severity, another.getNewSizeOf(severity), Integer::sum); } fixedSize += another.getFixedSize(); } return this; }  }
CompositeBuildResult implements AnalysisBuildResult { public CompositeBuildResult add(final AnalysisBuildResult... additionalResults) { for (AnalysisBuildResult another : additionalResults) { sizesPerOrigin.putAll(another.getSizePerOrigin()); for (Severity severity : Severity.getPredefinedValues()) { sizesPerSeverity.merge(severity, another.getTotalSizeOf(severity), Integer::sum); newSizesPerSeverity.merge(severity, another.getNewSizeOf(severity), Integer::sum); } fixedSize += another.getFixedSize(); } return this; }  CompositeBuildResult add(final AnalysisBuildResult... additionalResults); @Override Map<String, Integer> getSizePerOrigin(); @Override int getFixedSize(); @Override int getTotalSize(); @Override int getTotalSizeOf(final Severity severity); @Override int getNewSize(); @Override int getNewSizeOf(final Severity severity); }
CompositeBuildResult implements AnalysisBuildResult { public CompositeBuildResult add(final AnalysisBuildResult... additionalResults) { for (AnalysisBuildResult another : additionalResults) { sizesPerOrigin.putAll(another.getSizePerOrigin()); for (Severity severity : Severity.getPredefinedValues()) { sizesPerSeverity.merge(severity, another.getTotalSizeOf(severity), Integer::sum); newSizesPerSeverity.merge(severity, another.getNewSizeOf(severity), Integer::sum); } fixedSize += another.getFixedSize(); } return this; }  CompositeBuildResult add(final AnalysisBuildResult... additionalResults); @Override Map<String, Integer> getSizePerOrigin(); @Override int getFixedSize(); @Override int getTotalSize(); @Override int getTotalSizeOf(final Severity severity); @Override int getNewSize(); @Override int getNewSizeOf(final Severity severity);  }