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

IllegalArgumentException in withCapture(List) #307

Closed
krororo opened this Issue Jun 28, 2016 · 2 comments

Comments

2 participants
@krororo

krororo commented Jun 28, 2016

Please provide the following information:

  • Version of JMockit that was used:
    1.25
  • Description of the problem or enhancement request:

example code

    public class Hoge {
        public void foo(List<String> arg) {
            return;
        }
    }

    @Test
    public void testSample(@Mocked final Hoge mock) {
        mock.foo(Arrays.asList("a", "b", "c"));
        mock.foo(Arrays.asList("d", "e", "f"));

        new Verifications() { {
            List<List<String>> actual = new ArrayList<>();

            mock.foo(withCapture(actual));

            assertThat(actual.get(0), contains("a", "b", "c"));
            assertThat(actual.get(1), contains("d", "e", "f"));
        } };
    }

It works on 1.24. But on 1.25, java.lang.IllegalArgumentException: No class with name "java.util.List<Ljava.lang.String" found occurred.

@rliesenfeld rliesenfeld added the bug label Jun 28, 2016

@rliesenfeld rliesenfeld self-assigned this Jun 28, 2016

@rliesenfeld

This comment has been minimized.

Show comment
Hide comment
@rliesenfeld

rliesenfeld Jun 28, 2016

Member

Thanks for reporting.
As a workaround until the regression is fixed, the problem can be avoided by moving the capturing variable outside the verification block.

Member

rliesenfeld commented Jun 28, 2016

Thanks for reporting.
As a workaround until the regression is fixed, the problem can be avoided by moving the capturing variable outside the verification block.

@rliesenfeld

This comment has been minimized.

Show comment
Hide comment
@rliesenfeld

rliesenfeld Jul 2, 2016

Member

Fixed.

Member

rliesenfeld commented Jul 2, 2016

Fixed.

@rliesenfeld rliesenfeld closed this Jul 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment