Skip to content
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

ClassCastException when calling methods on mocks configured via Expectations from EDT #318

Closed
wigbam opened this issue Aug 11, 2016 · 0 comments
Assignees
Labels
bug

Comments

@wigbam
Copy link

@wigbam wigbam commented Aug 11, 2016

This issue is related to #181

Easy to reproduce:

@Test
public void testExpectationsFromEDT(final @Mocked java.util.concurrent.Callable<Boolean> b) throws Exception {
    new Expectations() /* @formatter:off */ {{
        b.call(); result = true;
    }}; // @formatter:on

    javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
        @Override
        public void run() {
            try {
                org.junit.Assert.assertTrue(b.call());
            } catch (final Exception ex) {
                throw new RuntimeException(ex);
            }
        }
    });
}
@wigbam wigbam changed the title ClassCastException when calling invoking methods on mocks configured via Expectations from EDT ClassCastException when calling methods on mocks configured via Expectations from EDT Aug 11, 2016
@rliesenfeld rliesenfeld added the bug label Aug 11, 2016
@rliesenfeld rliesenfeld self-assigned this Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.