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

LinkageError when mocking certain classes #373

Closed
bindungszustandsamplitude opened this issue Feb 6, 2023 · 3 comments
Closed

LinkageError when mocking certain classes #373

bindungszustandsamplitude opened this issue Feb 6, 2023 · 3 comments

Comments

@bindungszustandsamplitude

Hello together,

since EasyMock 5.1.0, I get a LinkageError when I try to create a mock for certain classes. I saw it first for javax.security classes such as LoginContext. In version 5.0.1, this worked without an issue.

Step to reproduce:
It could be reproduced by the following dummy test:

@Test
void test() {
    EasyMock.mock(javax.security.auth.login.LoginContext.class);
}

Expected behaviour:
A mock for the class LoginContext gets created.

Actual behaviour
An exception with the following cause is thrown:

java.lang.LinkageError: bad field type alias: class org.easymock.internal.ClassMockingData not visible from class javax.security.auth.login.LoginContext$$$EasyMock$1

EasyMock Version: 5.1.0
Java version: Temurin 11 for macOS (OpenJDK11U-jdk_aarch64_mac_hotspot_11.0.18_10)

@henri-tremblay
Copy link
Contributor

Yes. It's fixed with #356. Should release soon when I have 2 minutes.

@dmatej
Copy link

dmatej commented Mar 7, 2023

Just FYI, I have the same issue with the InitialContext on 5.1.0.

        mockSupport = new EasyMockSupport();
        initialContext = mockSupport.createMock(InitialContext.class);

I can confirm that with 5.2.0-SNAPSHOT ( 264a75d ) works well. When can we expect the release?

@arjantijms
Copy link

A release would be great indeed, thanks in advance!

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

No branches or pull requests

4 participants