+ public void webOfTrustContextUpdateJobsAreEqualIfTheirClassOwnIdentityAndContextAreEqual() {
+ WebOfTrustContextUpdateJob secondContextUpdateJob = webOfTrustUpdater.new WebOfTrustContextUpdateJob(ownIdentity, CONTEXT);
+ assertThat(contextUpdateJob.equals(secondContextUpdateJob), is(true));
+ assertThat(secondContextUpdateJob.equals(contextUpdateJob), is(true));
+ assertThat(contextUpdateJob.hashCode(), is(secondContextUpdateJob.hashCode()));
+ }
+
+ @Test
+ public void webOfTrustContextUpdatesJobsAreNotEqualIfTheirClassDiffers() {
+ assertThat(contextUpdateJob.equals(addContextJob), is(false));
+ }
+
+ @Test
+ public void webOfTrustContextUpdateJobToStringContainsIdentityAndContext() {
+ assertThat(contextUpdateJob.toString(), containsString(ownIdentity.toString()));
+ assertThat(contextUpdateJob.toString(), containsString(CONTEXT));
+ }
+
+ @Test
+ public void webOfTrustContextUpdateJobsAreNotEqualIfTheIdentitiesDiffer() {
+ OwnIdentity ownIdentity = mock(OwnIdentity.class);
+ WebOfTrustContextUpdateJob secondContextUpdateJob = webOfTrustUpdater.new WebOfTrustContextUpdateJob(ownIdentity, CONTEXT);
+ assertThat(contextUpdateJob.equals(secondContextUpdateJob), is(false));
+ assertThat(secondContextUpdateJob.equals(contextUpdateJob), is(false));
+ }
+
+ @Test
+ public void webOfTrustContextUpdateJobsAreNotEqualIfTheirContextsDiffer() {
+ WebOfTrustContextUpdateJob secondContextUpdateJob = webOfTrustUpdater.new WebOfTrustContextUpdateJob(ownIdentity, CONTEXT + CONTEXT);
+ assertThat(contextUpdateJob.equals(secondContextUpdateJob), is(false));
+ assertThat(secondContextUpdateJob.equals(contextUpdateJob), is(false));
+ }
+
+ @Test
+ public void webOfTrustContextUpdateJobsAreNotEqualToNull() {
+ assertThat(contextUpdateJob.equals(null), is(false));
+ }
+
+ @Test