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

MockedTypeCascade:230 NPE #353

Closed
Milbor-zz opened this issue Oct 10, 2016 · 1 comment
Closed

MockedTypeCascade:230 NPE #353

Milbor-zz opened this issue Oct 10, 2016 · 1 comment
Assignees
Labels

Comments

@Milbor-zz
Copy link

@Milbor-zz Milbor-zz commented Oct 10, 2016

public class JMockitTest {
    @Injectable
    private Manager manager;
    @Injectable
    private User user;

    interface Manager {
        <T extends Entity> T find(Class<T> clazz);
    }

    interface Entity {
    }

    static class User implements Entity {
    }

    @Test
    public void test() throws Exception {
        new Expectations() {{
            manager.find(User.class);
            result = user;
        }};
        final Entity actual = manager.find(User.class);
        assertSame(actual, user);
    }
}

produces NPE in MockedTypeCascade.getGenericReturnType, version 1.28, 1.25. Is this not supported? Thank you.

@rliesenfeld rliesenfeld self-assigned this Oct 10, 2016
@rliesenfeld
Copy link
Member

@rliesenfeld rliesenfeld commented Oct 10, 2016

Thanks for reporting, it's a bug.

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

No branches or pull requests

2 participants