{"action":"created","issue":{"url":"https://api.github.com/repos/powermock/powermock/issues/928","repository_url":"https://api.github.com/repos/powermock/powermock","labels_url":"https://api.github.com/repos/powermock/powermock/issues/928/labels{/name}","comments_url":"https://api.github.com/repos/powermock/powermock/issues/928/comments","events_url":"https://api.github.com/repos/powermock/powermock/issues/928/events","html_url":"https://github.com/powermock/powermock/issues/928","id":346112209,"node_id":"MDU6SXNzdWUzNDYxMTIyMDk=","number":928,"title":"Cannot cast org.powermock.api.mockito.mockmaker.PowerMockMaker to org.mockito.plugins.MockMaker","user":{"login":"wgslucky","id":5077205,"node_id":"MDQ6VXNlcjUwNzcyMDU=","avatar_url":"https://avatars0.githubusercontent.com/u/5077205?v=4","gravatar_id":"","url":"https://api.github.com/users/wgslucky","html_url":"https://github.com/wgslucky","followers_url":"https://api.github.com/users/wgslucky/followers","following_url":"https://api.github.com/users/wgslucky/following{/other_user}","gists_url":"https://api.github.com/users/wgslucky/gists{/gist_id}","starred_url":"https://api.github.com/users/wgslucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wgslucky/subscriptions","organizations_url":"https://api.github.com/users/wgslucky/orgs","repos_url":"https://api.github.com/users/wgslucky/repos","events_url":"https://api.github.com/users/wgslucky/events{/privacy}","received_events_url":"https://api.github.com/users/wgslucky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-31T09:43:59Z","updated_at":"2018-11-17T14:03:37Z","closed_at":null,"author_association":"NONE","body":"My powermock and test dependency in pom.xml is :\r\n\r\n```java\r\n\r\n<dependency>\r\n\t\t\t<groupId>org.testng</groupId>\r\n\t\t\t<artifactId>testng</artifactId>\r\n\t\t\t<version>6.14.3</version>\r\n\t\t\t<scope>test</scope>\r\n\t\t</dependency>\r\n\r\n\t\t<dependency>\r\n\t\t\t<groupId>org.powermock</groupId>\r\n\t\t\t<artifactId>powermock-module-testng</artifactId>\r\n\t\t\t<version>2.0.0-beta.5</version>\r\n\t\t\t<scope>test</scope>\r\n\t\t\t<exclusions>\r\n\t\t\t\t<exclusion>\r\n\t\t\t\t\t<groupId>org.testng</groupId>\r\n\t\t\t\t\t<artifactId>testng</artifactId>\r\n\t\t\t\t</exclusion>\r\n\t\t\t</exclusions>\r\n\t\t</dependency>\r\n\r\n\t\t<dependency>\r\n\t\t\t<groupId>org.mockito</groupId>\r\n\t\t\t<artifactId>mockito-core</artifactId>\r\n\t\t\t<version>2.19.0</version>\r\n\t\t\t<scope>test</scope>\r\n\t\t</dependency>\r\n\r\n\t\t<dependency>\r\n\t\t\t<groupId>org.powermock</groupId>\r\n\t\t\t<artifactId>powermock-core</artifactId>\r\n\t\t\t<version>2.0.0-beta.5</version>\r\n\t\t\t<scope>test</scope>\r\n\t\t\t<exclusions>\r\n\t\t\t\t<exclusion>\r\n\t\t\t\t\t<groupId>org.javassist</groupId>\r\n\t\t\t\t\t<artifactId>javassist</artifactId>\r\n\t\t\t\t</exclusion>\r\n\t\t\t</exclusions>\r\n\t\t</dependency>\r\n\r\n\t\t<dependency>\r\n\t\t\t<groupId>org.powermock</groupId>\r\n\t\t\t<artifactId>powermock-api-mockito2</artifactId>\r\n\t\t\t<version>2.0.0-beta.5</version>\r\n\t\t\t<scope>test</scope>\r\n\t\t</dependency>\r\n\r\n````\r\n\r\nwhen I use suite.xml to test group by testng and powermockito,if I add @PrepareForTest on test claas,and will throw this exception:\r\n\r\n```java\r\njava.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)\r\n\tat org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:74)\r\n\tat com.sun.proxy.$Proxy25.isTypeMockable(Unknown Source)\r\n\tat org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:29)\r\n\tat org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)\r\n\tat org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:232)\r\n\tat org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java:226)\r\n\tat org.mockito.internal.MockitoCore.mock(MockitoCore.java:64)\r\n\tat org.mockito.Mockito.mock(Mockito.java:1871)\r\n\tat org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMethodInvocationControl(DefaultMockCreator.java:108)\r\n\tat org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.doCreateMock(DefaultMockCreator.java:61)\r\n\tat org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.createMock(DefaultMockCreator.java:53)\r\n\tat org.powermock.api.mockito.internal.mockcreation.DefaultMockCreator.mock(DefaultMockCreator.java:40)\r\n\tat org.powermock.api.mockito.PowerMockito.mockStatic(PowerMockito.java:62)\r\n\tat gamebase.topjoy.dk.gs.service.PlayerServiceTest.init(PlayerServiceTest.java:31)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.base/java.lang.reflect.Method.invoke(Method.java:564)\r\n\tat org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)\r\n\tat org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)\r\n\tat org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)\r\n\tat org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)\r\n\tat org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)\r\n\tat org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)\r\n\tat org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)\r\n\tat org.testng.TestRunner.privateRun(TestRunner.java:648)\r\n\tat org.testng.TestRunner.run(TestRunner.java:505)\r\n\tat org.testng.SuiteRunner.runTest(SuiteRunner.java:455)\r\n\tat org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)\r\n\tat org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)\r\n\tat org.testng.SuiteRunner.run(SuiteRunner.java:364)\r\n\tat org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)\r\n\tat org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)\r\n\tat org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)\r\n\tat org.testng.TestNG.runSuitesLocally(TestNG.java:1137)\r\n\tat org.testng.TestNG.runSuites(TestNG.java:1049)\r\n\tat org.testng.TestNG.run(TestNG.java:1017)\r\n\tat org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)\r\n\tat org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)\r\n\tat org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)\r\nCaused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in java.lang.CompoundEnumeration@1894593a\r\n\tat org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:54)\r\n\tat org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:57)\r\n\tat org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:44)\r\n\tat org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:21)\r\n\tat org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:18)\r\n\tat org.mockito.internal.util.MockUtil.<clinit>(MockUtil.java:24)\r\n\t... 37 more\r\nCaused by: java.lang.ClassCastException: Cannot cast org.powermock.api.mockito.mockmaker.PowerMockMaker to org.mockito.plugins.MockMaker\r\n\tat java.base/java.lang.Class.cast(Class.java:3558)\r\n\tat org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java:50)\r\n\t... 42 more\r\n\r\n````"},"comment":{"url":"https://api.github.com/repos/powermock/powermock/issues/comments/439619310","html_url":"https://github.com/powermock/powermock/issues/928#issuecomment-439619310","issue_url":"https://api.github.com/repos/powermock/powermock/issues/928","id":439619310,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTYxOTMxMA==","user":{"login":"abhsinh2","id":4527774,"node_id":"MDQ6VXNlcjQ1Mjc3NzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/4527774?v=4","gravatar_id":"","url":"https://api.github.com/users/abhsinh2","html_url":"https://github.com/abhsinh2","followers_url":"https://api.github.com/users/abhsinh2/followers","following_url":"https://api.github.com/users/abhsinh2/following{/other_user}","gists_url":"https://api.github.com/users/abhsinh2/gists{/gist_id}","starred_url":"https://api.github.com/users/abhsinh2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhsinh2/subscriptions","organizations_url":"https://api.github.com/users/abhsinh2/orgs","repos_url":"https://api.github.com/users/abhsinh2/repos","events_url":"https://api.github.com/users/abhsinh2/events{/privacy}","received_events_url":"https://api.github.com/users/abhsinh2/received_events","type":"User","site_admin":false},"created_at":"2018-11-17T14:03:37Z","updated_at":"2018-11-17T14:03:37Z","author_association":"NONE","body":"any solution to this?"}}
{"actor":{"display_login":"abhsinh2"}}