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

Add support for Mockito 2.X #33

Closed
wants to merge 1 commit into from
Closed

Conversation

eygraber
Copy link

@eygraber eygraber commented Sep 5, 2016

No description provided.

@jpshelley
Copy link

RC1 was just released. Might be worth updating to at least the RC1.

@jpshelley
Copy link

@eygraber Mockito 2.1 has reached non-beta. Could you update to the full release?

@swankjesse
Copy link
Contributor

Nice.

if(Modifier.isFinal(type.getModifiers())) {
return "final or anonymous class";
}
return "\nnot handled type";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the \n ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure ¯_(ツ)_/¯

I think it's safe to take it out.

@@ -42,7 +42,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.5</version>
<version>2.1.0-beta.120</version>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use the non-beta version since its a full release build now.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, forgot about this PR.

@eygraber
Copy link
Author

@swankjesse @jpshelley fixed

@eygraber eygraber changed the title Add support for Mockito 2 beta Add support for Mockito 2.X Oct 16, 2016
@viniciussoares
Copy link

viniciussoares commented Oct 17, 2016

I'm getting an exception 🤔 Using it with kotlin 1.0.4 throught jitpack (com.github.eygraber:dexmaker:mockito2-SNAPSHOT).

java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/management/ManagementFactory;
at net.bytebuddy.agent.ByteBuddyAgent$ProcessProvider$ForCurrentVm$ForLegacyVm.resolve(ByteBuddyAgent.java:728)
at net.bytebuddy.agent.ByteBuddyAgent$ProcessProvider$ForCurrentVm.resolve(ByteBuddyAgent.java:708)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:280)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:248)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:234)
at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.<init>(InlineByteBuddyMockMaker.java:96)
at java.lang.Class.newInstance(Native Method)
at org.mockito.internal.configuration.plugins.PluginLoader.loadImpl(PluginLoader.java:77)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:36)
at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:13)
at org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:12)
at org.mockito.internal.configuration.plugins.Plugins.getMockMaker(Plugins.java:28)
at org.mockito.internal.util.MockUtil.<clinit>(MockUtil.java:24)
at org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
at org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:168)
at org.mockito.internal.creation.MockSettingsImpl.confirm(MockSettingsImpl.java:162)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:62)
at org.mockito.Mockito.mock(Mockito.java:1620)
at org.mockito.Mockito.mock(Mockito.java:1533)

@drewhannay
Copy link
Contributor

Thanks for the PR @eygraber. Unfortunately after converting the project to gradle, your PR no longer applies cleanly, so I'm just going to add this change with #52.

@drewhannay drewhannay closed this Dec 8, 2016
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

Successfully merging this pull request may close these issues.

5 participants