New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerMock.replayAll does not handle mocks created by annotation processor for `org.easymock.Mock` annotation #849

Closed
thekingnothing opened this Issue Sep 16, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@thekingnothing
Member

thekingnothing commented Sep 16, 2017

After 1.6.3 PowerMock switched to easy mock annotation processing for org.easymock.Mock annotation. As result, mocks are created by EasyMock is not tracked by PowerMock any more. So PowerMock.replayAll switch to replay mode only mocks created by PowerMock.

Example:


@RunWith(PowerMockRunner.class)
public class EasyMockAnnotationTest {
    
    @Mock
    private Service serviceMock;
    
    @Test
    public void replayAll_should_switch_to_replay_mode_mocks_created_by_easymock_annotation_processing() {
        expect(serviceMock.getServiceMessage()).andReturn("value");
    
        PowerMock.replayAll();
        
        assertEquals("value", serviceMock.getServiceMessage());
    }
}

thekingnothing added a commit that referenced this issue Sep 16, 2017

Fixed #849 PowerMock.replayAll does not handle mocks created by annot…
…ation processor for `org.easymock.Mock` annotation

thekingnothing added a commit that referenced this issue Sep 16, 2017

Fixed #849 PowerMock.replayAll does not handle mocks created by annot…
…ation processor for `org.easymock.Mock` annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment