Skip to content

Commit

Permalink
Fixes #2331
Browse files Browse the repository at this point in the history
Has conditionally on basis of whether default answer is pass to actual methods made hash code and equals pass to actual methods.
Intellij seems to had only pushed import and not the test
  • Loading branch information
saurabh7248 committed Jul 30, 2021
1 parent c2ce6a6 commit 6886b0f
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -193,4 +193,13 @@ public void shouldSayNiceMessageWhenSpyingOnPrivateClass() throws Exception {
"Most likely it is due to mocking a private class that is not visible to Mockito");
}
}

@Test
public void spysHashCodeEqualsDelegatedToActualMethods() {
List<String> real = new ArrayList<>();
real.add("one");
List<String> spy = spy(real);
assertEquals(real.hashCode(), spy.hashCode());
assertTrue(spy.equals(real));
}
}

0 comments on commit 6886b0f

Please sign in to comment.