@Test void shouldMergeNumberOfTotalIssues() { AnalysisBuildResult first = createAnalysisBuildResult(1, 2, 3, 4); AnalysisBuildResult second = createAnalysisBuildResult(5, 6, 7, 8); CompositeBuildResult run = new CompositeBuildResult(); assertThat(run).hasTotalSize(0); assertThat(run.add(first)).hasTotalSize(10); assertThat(run.add(second)).hasTotalSize(36); }
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);  }