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

Upgrade to the latest version of Mockk 1.13.2 #87

Closed
alo-id opened this issue Sep 30, 2022 · 4 comments
Closed

Upgrade to the latest version of Mockk 1.13.2 #87

alo-id opened this issue Sep 30, 2022 · 4 comments

Comments

@alo-id
Copy link

alo-id commented Sep 30, 2022

I would like to use the new Mockk version in my project without having to exclude it from each of my poms.

@jnizet
Copy link
Member

jnizet commented Sep 30, 2022

Hi @alo-id

I will eventually create a new version of SpringMockK that depends on a newer version of MockK, but you can simply specify the version of MockK that you want in your own dependencies. No need to wait for a new version of SpringMockK.

@alo-id
Copy link
Author

alo-id commented Sep 30, 2022

I understand. I was hoping not having to do this since there is a major version release for MockK.

@jnizet jnizet closed this as completed Sep 30, 2022
@MarkWilsoncom
Copy link

We´ve just upgraded to Mockk 1.13.2 and are having issues with projects which also use springmockk in unit tests.
Getting an error: java.lang.NoClassDefFoundError: io/mockk/ValueClassSupportKt

So as a workaround we have to exclude mockk from the springmockk dependency.

    <dependency>
        <groupId>com.ninja-squad</groupId>
        <artifactId>springmockk</artifactId>
        <version>${springmockk.version}</version>
        <scope>test</scope>
        <!-- Springmockk still uses mockk 1.12.x. Remove when updated to use 1.13.x -->
        <exclusions>
            <exclusion>
                <groupId>io.mockk</groupId>
                <artifactId>mockk</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

@jnizet
Copy link
Member

jnizet commented Sep 30, 2022

@MarkWilsoncom The documentation of mockk now recommends using using io.mockk:mockk when using gradle (which works fine in one of my projects), but io.mockk:mockk-jvmwhen using Maven. I have no clear idea why, and am not sure why there's a difference and how I should deal with this.

Besides, in another issue, I've been told that we would be able to use the io.mockk:mockk coordinates in Maven too at some time.
So I don't plan to do anything now, until the situation is clearer.

My recommendation would be to use gradle instead of Maven :-)

Feel free to open an issue on the mockk repo to know why the dependencies differ betweeb gradle and maven, and when we'll be able to use the same one everywhere.

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

No branches or pull requests

3 participants