PowerMock and Mockito UnfinishedVerificationException
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am having difficulties getting PowerMock and Mockito to work.
I am using these versions. They should be compatible.
- powermock-core v 1.7.4
- powermock-api-mockito v 1.7.4
- powermock-module-junit4 v 1.7.4
- mockito-all v 1.10.19
I am also using TestNG, but I do not believe this has any affect on the outcome of this test.
I want to mock an object, call a method on the mocked object, and verify that a private method was called once within the mocked objects method.
I have constructed an example, that hopefully explains what I want to accomplish.
public class MyClass {
public void execute(Object o) {
valid(o);
}
private boolean valid(Object o) {
return o != null;
}
}
This is my test class
@RunWith(PowerMockRunner.class)
@PrepareForTest(MyClass.class)
public class TestClass {
@After
public void validate() {
validateMockitoUsage();
}
@Test
public void executeTest() throws Exception {
//Initialize the Class and create the spy
MyClass myClass = PowerMockito.spy(new MyClass());
//Execute the method which I wish to test
myClass.execute(null);
//I want to verify that the private valid method was called once.
PowerMockito.verifyPrivate(myClass, times(1)).invoke("valid", anyObject());
}
}
I get the following error:
org.mockito.exceptions.misusing.UnfinishedVerificationException:
Missing method call for verify(mock) here:
-> at TestClass.executeTest(MyClass.java:14)
Example of correct verification:
verify(mock).doSomething()
Also, this error might show up because you verify either of:
final/private/equals()/hashCode() methods.
Those methods *cannot* be stubbed/verified.
Mocking methods declared on non-public parent classes is not supported.
at TestClass.validate(MyClass.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
I have tried to search, but I could not find a solution for my problem. I believe this is a common error, and I am using PowerMock/Mockito wrong.
java mockito testng powermock powermockito
|
show 8 more comments
I am having difficulties getting PowerMock and Mockito to work.
I am using these versions. They should be compatible.
- powermock-core v 1.7.4
- powermock-api-mockito v 1.7.4
- powermock-module-junit4 v 1.7.4
- mockito-all v 1.10.19
I am also using TestNG, but I do not believe this has any affect on the outcome of this test.
I want to mock an object, call a method on the mocked object, and verify that a private method was called once within the mocked objects method.
I have constructed an example, that hopefully explains what I want to accomplish.
public class MyClass {
public void execute(Object o) {
valid(o);
}
private boolean valid(Object o) {
return o != null;
}
}
This is my test class
@RunWith(PowerMockRunner.class)
@PrepareForTest(MyClass.class)
public class TestClass {
@After
public void validate() {
validateMockitoUsage();
}
@Test
public void executeTest() throws Exception {
//Initialize the Class and create the spy
MyClass myClass = PowerMockito.spy(new MyClass());
//Execute the method which I wish to test
myClass.execute(null);
//I want to verify that the private valid method was called once.
PowerMockito.verifyPrivate(myClass, times(1)).invoke("valid", anyObject());
}
}
I get the following error:
org.mockito.exceptions.misusing.UnfinishedVerificationException:
Missing method call for verify(mock) here:
-> at TestClass.executeTest(MyClass.java:14)
Example of correct verification:
verify(mock).doSomething()
Also, this error might show up because you verify either of:
final/private/equals()/hashCode() methods.
Those methods *cannot* be stubbed/verified.
Mocking methods declared on non-public parent classes is not supported.
at TestClass.validate(MyClass.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
I have tried to search, but I could not find a solution for my problem. I believe this is a common error, and I am using PowerMock/Mockito wrong.
java mockito testng powermock powermockito
The first thing I see is that you should probably should be preparingMyClass
instead ofTestClass
. See if that helps?
– Stalemate Of Tuning
Jan 4 at 15:50
Well spotted. This is unfortunately just a typo when I wrote the SO question. I have fixed the typo.
– kkflf
Jan 4 at 15:52
2
I am not able to reproduce this issue. When I run it, it works fine. I just had to change the matcher slightly.
– Stalemate Of Tuning
Jan 4 at 16:10
2
I found the issue after you reported back that you could not reproduce this issue. The issue is afterall TestNG. Everything works perfectly when I use junit4. Thank you all for suggestions.
– kkflf
Jan 4 at 16:18
1
It is often the small things ;) Reporting back that you cannot reproduce a problem is often the solution. You can create an answer with your comment and I will accept it.
– kkflf
Jan 4 at 16:21
|
show 8 more comments
I am having difficulties getting PowerMock and Mockito to work.
I am using these versions. They should be compatible.
- powermock-core v 1.7.4
- powermock-api-mockito v 1.7.4
- powermock-module-junit4 v 1.7.4
- mockito-all v 1.10.19
I am also using TestNG, but I do not believe this has any affect on the outcome of this test.
I want to mock an object, call a method on the mocked object, and verify that a private method was called once within the mocked objects method.
I have constructed an example, that hopefully explains what I want to accomplish.
public class MyClass {
public void execute(Object o) {
valid(o);
}
private boolean valid(Object o) {
return o != null;
}
}
This is my test class
@RunWith(PowerMockRunner.class)
@PrepareForTest(MyClass.class)
public class TestClass {
@After
public void validate() {
validateMockitoUsage();
}
@Test
public void executeTest() throws Exception {
//Initialize the Class and create the spy
MyClass myClass = PowerMockito.spy(new MyClass());
//Execute the method which I wish to test
myClass.execute(null);
//I want to verify that the private valid method was called once.
PowerMockito.verifyPrivate(myClass, times(1)).invoke("valid", anyObject());
}
}
I get the following error:
org.mockito.exceptions.misusing.UnfinishedVerificationException:
Missing method call for verify(mock) here:
-> at TestClass.executeTest(MyClass.java:14)
Example of correct verification:
verify(mock).doSomething()
Also, this error might show up because you verify either of:
final/private/equals()/hashCode() methods.
Those methods *cannot* be stubbed/verified.
Mocking methods declared on non-public parent classes is not supported.
at TestClass.validate(MyClass.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
I have tried to search, but I could not find a solution for my problem. I believe this is a common error, and I am using PowerMock/Mockito wrong.
java mockito testng powermock powermockito
I am having difficulties getting PowerMock and Mockito to work.
I am using these versions. They should be compatible.
- powermock-core v 1.7.4
- powermock-api-mockito v 1.7.4
- powermock-module-junit4 v 1.7.4
- mockito-all v 1.10.19
I am also using TestNG, but I do not believe this has any affect on the outcome of this test.
I want to mock an object, call a method on the mocked object, and verify that a private method was called once within the mocked objects method.
I have constructed an example, that hopefully explains what I want to accomplish.
public class MyClass {
public void execute(Object o) {
valid(o);
}
private boolean valid(Object o) {
return o != null;
}
}
This is my test class
@RunWith(PowerMockRunner.class)
@PrepareForTest(MyClass.class)
public class TestClass {
@After
public void validate() {
validateMockitoUsage();
}
@Test
public void executeTest() throws Exception {
//Initialize the Class and create the spy
MyClass myClass = PowerMockito.spy(new MyClass());
//Execute the method which I wish to test
myClass.execute(null);
//I want to verify that the private valid method was called once.
PowerMockito.verifyPrivate(myClass, times(1)).invoke("valid", anyObject());
}
}
I get the following error:
org.mockito.exceptions.misusing.UnfinishedVerificationException:
Missing method call for verify(mock) here:
-> at TestClass.executeTest(MyClass.java:14)
Example of correct verification:
verify(mock).doSomething()
Also, this error might show up because you verify either of:
final/private/equals()/hashCode() methods.
Those methods *cannot* be stubbed/verified.
Mocking methods declared on non-public parent classes is not supported.
at TestClass.validate(MyClass.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:646)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
I have tried to search, but I could not find a solution for my problem. I believe this is a common error, and I am using PowerMock/Mockito wrong.
java mockito testng powermock powermockito
java mockito testng powermock powermockito
edited Jan 4 at 15:51
kkflf
asked Jan 4 at 15:47
kkflfkkflf
1,2331024
1,2331024
The first thing I see is that you should probably should be preparingMyClass
instead ofTestClass
. See if that helps?
– Stalemate Of Tuning
Jan 4 at 15:50
Well spotted. This is unfortunately just a typo when I wrote the SO question. I have fixed the typo.
– kkflf
Jan 4 at 15:52
2
I am not able to reproduce this issue. When I run it, it works fine. I just had to change the matcher slightly.
– Stalemate Of Tuning
Jan 4 at 16:10
2
I found the issue after you reported back that you could not reproduce this issue. The issue is afterall TestNG. Everything works perfectly when I use junit4. Thank you all for suggestions.
– kkflf
Jan 4 at 16:18
1
It is often the small things ;) Reporting back that you cannot reproduce a problem is often the solution. You can create an answer with your comment and I will accept it.
– kkflf
Jan 4 at 16:21
|
show 8 more comments
The first thing I see is that you should probably should be preparingMyClass
instead ofTestClass
. See if that helps?
– Stalemate Of Tuning
Jan 4 at 15:50
Well spotted. This is unfortunately just a typo when I wrote the SO question. I have fixed the typo.
– kkflf
Jan 4 at 15:52
2
I am not able to reproduce this issue. When I run it, it works fine. I just had to change the matcher slightly.
– Stalemate Of Tuning
Jan 4 at 16:10
2
I found the issue after you reported back that you could not reproduce this issue. The issue is afterall TestNG. Everything works perfectly when I use junit4. Thank you all for suggestions.
– kkflf
Jan 4 at 16:18
1
It is often the small things ;) Reporting back that you cannot reproduce a problem is often the solution. You can create an answer with your comment and I will accept it.
– kkflf
Jan 4 at 16:21
The first thing I see is that you should probably should be preparing
MyClass
instead of TestClass
. See if that helps?– Stalemate Of Tuning
Jan 4 at 15:50
The first thing I see is that you should probably should be preparing
MyClass
instead of TestClass
. See if that helps?– Stalemate Of Tuning
Jan 4 at 15:50
Well spotted. This is unfortunately just a typo when I wrote the SO question. I have fixed the typo.
– kkflf
Jan 4 at 15:52
Well spotted. This is unfortunately just a typo when I wrote the SO question. I have fixed the typo.
– kkflf
Jan 4 at 15:52
2
2
I am not able to reproduce this issue. When I run it, it works fine. I just had to change the matcher slightly.
– Stalemate Of Tuning
Jan 4 at 16:10
I am not able to reproduce this issue. When I run it, it works fine. I just had to change the matcher slightly.
– Stalemate Of Tuning
Jan 4 at 16:10
2
2
I found the issue after you reported back that you could not reproduce this issue. The issue is afterall TestNG. Everything works perfectly when I use junit4. Thank you all for suggestions.
– kkflf
Jan 4 at 16:18
I found the issue after you reported back that you could not reproduce this issue. The issue is afterall TestNG. Everything works perfectly when I use junit4. Thank you all for suggestions.
– kkflf
Jan 4 at 16:18
1
1
It is often the small things ;) Reporting back that you cannot reproduce a problem is often the solution. You can create an answer with your comment and I will accept it.
– kkflf
Jan 4 at 16:21
It is often the small things ;) Reporting back that you cannot reproduce a problem is often the solution. You can create an answer with your comment and I will accept it.
– kkflf
Jan 4 at 16:21
|
show 8 more comments
2 Answers
2
active
oldest
votes
As you are using TestNG to run your test, the @RunWith annotation is ignored as it is specific to JUnit.
To make this work, you have 2 options:
Run your test with JUnit.
OR Configure TestNG so that it uses PowerMock object factory. The configuration details are pretty well explained here.
add a comment |
I was unable to replicate the issue myself on junit4. It turns out that it was an issue with TestNG.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042140%2fpowermock-and-mockito-unfinishedverificationexception%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As you are using TestNG to run your test, the @RunWith annotation is ignored as it is specific to JUnit.
To make this work, you have 2 options:
Run your test with JUnit.
OR Configure TestNG so that it uses PowerMock object factory. The configuration details are pretty well explained here.
add a comment |
As you are using TestNG to run your test, the @RunWith annotation is ignored as it is specific to JUnit.
To make this work, you have 2 options:
Run your test with JUnit.
OR Configure TestNG so that it uses PowerMock object factory. The configuration details are pretty well explained here.
add a comment |
As you are using TestNG to run your test, the @RunWith annotation is ignored as it is specific to JUnit.
To make this work, you have 2 options:
Run your test with JUnit.
OR Configure TestNG so that it uses PowerMock object factory. The configuration details are pretty well explained here.
As you are using TestNG to run your test, the @RunWith annotation is ignored as it is specific to JUnit.
To make this work, you have 2 options:
Run your test with JUnit.
OR Configure TestNG so that it uses PowerMock object factory. The configuration details are pretty well explained here.
answered Jan 4 at 16:32
elyorelyor
525214
525214
add a comment |
add a comment |
I was unable to replicate the issue myself on junit4. It turns out that it was an issue with TestNG.
add a comment |
I was unable to replicate the issue myself on junit4. It turns out that it was an issue with TestNG.
add a comment |
I was unable to replicate the issue myself on junit4. It turns out that it was an issue with TestNG.
I was unable to replicate the issue myself on junit4. It turns out that it was an issue with TestNG.
answered Jan 4 at 16:22
Stalemate Of TuningStalemate Of Tuning
547315
547315
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042140%2fpowermock-and-mockito-unfinishedverificationexception%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The first thing I see is that you should probably should be preparing
MyClass
instead ofTestClass
. See if that helps?– Stalemate Of Tuning
Jan 4 at 15:50
Well spotted. This is unfortunately just a typo when I wrote the SO question. I have fixed the typo.
– kkflf
Jan 4 at 15:52
2
I am not able to reproduce this issue. When I run it, it works fine. I just had to change the matcher slightly.
– Stalemate Of Tuning
Jan 4 at 16:10
2
I found the issue after you reported back that you could not reproduce this issue. The issue is afterall TestNG. Everything works perfectly when I use junit4. Thank you all for suggestions.
– kkflf
Jan 4 at 16:18
1
It is often the small things ;) Reporting back that you cannot reproduce a problem is often the solution. You can create an answer with your comment and I will accept it.
– kkflf
Jan 4 at 16:21