@Test public void calculateFingerprint_shouldReturnTheSameFingerprint_givenTheSameExceptionTwice() throws Exception { Throwable t = new RuntimeException(); String expectedFingerprint = calculator.calculateFingerprint(t); String actualFingerprint = calculator.calculateFingerprint(t); assertEquals(expectedFingerprint, actualFingerprint); }
public String calculateFingerprint(Throwable t) { MessageDigest md5 = getMD5Instance(); PrintStream ps = new PrintStream(new DigestOutputStream(new DoNothingOutputStream(), md5)); t.printStackTrace(ps); return base64Encoder.encodeToString(md5.digest()); }
ThrowableFingerprintCalculator { public String calculateFingerprint(Throwable t) { MessageDigest md5 = getMD5Instance(); PrintStream ps = new PrintStream(new DigestOutputStream(new DoNothingOutputStream(), md5)); t.printStackTrace(ps); return base64Encoder.encodeToString(md5.digest()); } }
ThrowableFingerprintCalculator { public String calculateFingerprint(Throwable t) { MessageDigest md5 = getMD5Instance(); PrintStream ps = new PrintStream(new DigestOutputStream(new DoNothingOutputStream(), md5)); t.printStackTrace(ps); return base64Encoder.encodeToString(md5.digest()); }  }
ThrowableFingerprintCalculator { public String calculateFingerprint(Throwable t) { MessageDigest md5 = getMD5Instance(); PrintStream ps = new PrintStream(new DigestOutputStream(new DoNothingOutputStream(), md5)); t.printStackTrace(ps); return base64Encoder.encodeToString(md5.digest()); }  String calculateFingerprint(Throwable t); }
ThrowableFingerprintCalculator { public String calculateFingerprint(Throwable t) { MessageDigest md5 = getMD5Instance(); PrintStream ps = new PrintStream(new DigestOutputStream(new DoNothingOutputStream(), md5)); t.printStackTrace(ps); return base64Encoder.encodeToString(md5.digest()); }  String calculateFingerprint(Throwable t);  }