@Test public void testSpyingOnPrivateMethodWorks() throws Exception { when(partialMock, "getMyString").thenReturn("ikk2"); assertThat(partialMock.getMyString(), equalTo("ikk2")); assertThat(partialMock.getStringTwo(), equalTo("two")); }
@Test public void testDoNothingForSpy() { doNothing().when(partialMock).throwException(); partialMock.throwException(); }