@Test public void null_merged_with_existing_one_returns_existing() { SecHubResult r = new SecHubResult(); assertEquals(r,mergerToTest.merge(r, null)); assertEquals(r,mergerToTest.merge(null,r)); }
public SecHubResult merge(SecHubResult result1, SecHubResult result2) { if (result1==null) { return result2; } if (result2==null) { return result1; } SecHubResult merged = new SecHubResult(); mergeFindings(result1, merged); mergeFindings(result2, merged); mergeFalsePositives(result1, merged); mergeFalsePositives(result2, merged); merged.setCount(result1.getCount()+result2.getCount()); return merged; }
SecHubResultMerger { public SecHubResult merge(SecHubResult result1, SecHubResult result2) { if (result1==null) { return result2; } if (result2==null) { return result1; } SecHubResult merged = new SecHubResult(); mergeFindings(result1, merged); mergeFindings(result2, merged); mergeFalsePositives(result1, merged); mergeFalsePositives(result2, merged); merged.setCount(result1.getCount()+result2.getCount()); return merged; } }
SecHubResultMerger { public SecHubResult merge(SecHubResult result1, SecHubResult result2) { if (result1==null) { return result2; } if (result2==null) { return result1; } SecHubResult merged = new SecHubResult(); mergeFindings(result1, merged); mergeFindings(result2, merged); mergeFalsePositives(result1, merged); mergeFalsePositives(result2, merged); merged.setCount(result1.getCount()+result2.getCount()); return merged; }  }
SecHubResultMerger { public SecHubResult merge(SecHubResult result1, SecHubResult result2) { if (result1==null) { return result2; } if (result2==null) { return result1; } SecHubResult merged = new SecHubResult(); mergeFindings(result1, merged); mergeFindings(result2, merged); mergeFalsePositives(result1, merged); mergeFalsePositives(result2, merged); merged.setCount(result1.getCount()+result2.getCount()); return merged; }  SecHubResult merge(SecHubResult result1, SecHubResult result2); }
SecHubResultMerger { public SecHubResult merge(SecHubResult result1, SecHubResult result2) { if (result1==null) { return result2; } if (result2==null) { return result1; } SecHubResult merged = new SecHubResult(); mergeFindings(result1, merged); mergeFindings(result2, merged); mergeFalsePositives(result1, merged); mergeFalsePositives(result2, merged); merged.setCount(result1.getCount()+result2.getCount()); return merged; }  SecHubResult merge(SecHubResult result1, SecHubResult result2);  }