mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-19 07:44:23 +01:00
Merge pull request #264 from dwvisser/evidence-hashcode-contract
Evidence class compliance with Object.hashCode() contract Former-commit-id: 94898beb75c867b58a5f8a1cd879b7b47ab47cb5
This commit is contained in:
@@ -19,6 +19,7 @@ package org.owasp.dependencycheck.dependency;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -53,6 +54,14 @@ public class EvidenceTest {
|
||||
assertTrue(instance.equals(that8));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHashcodeContract() throws Exception {
|
||||
final Evidence titleCase = new Evidence("Manifest", "Implementation-Title", "Spring Framework", Confidence.HIGH);
|
||||
final Evidence lowerCase = new Evidence("manifest", "implementation-title", "spring framework", Confidence.HIGH);
|
||||
assertThat(titleCase, is(equalTo(lowerCase)));
|
||||
assertThat(titleCase.hashCode(), is(equalTo(lowerCase.hashCode())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of compareTo method, of class Evidence.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user