You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/15 13:37:51 UTC

[GitHub] [pulsar] mattisonchao opened a new pull request, #16628: [branch-2.9] Fix `MockStatic` method caused the exception

mattisonchao opened a new pull request, #16628:
URL: https://github.com/apache/pulsar/pull/16628

   ### Motivation
   
   Fix `MockStatic` method caused the exception.
   
   ```
   The used MockMaker PowerMockMaker does not support the creation of static mocks
   [3197](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3198)
   [3198](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3199)
   Mockito's inline mock maker supports static mocks based on the Instrumentation API.
   [3199](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3200)
   You can simply enable this mock mode, by placing the 'mockito-inline' artifact where you are currently using 'mockito-core'.
   [3200](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3201)
   Note that Mockito's inline mock maker is not supported on Android.
   [3201](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3202)
   	at org.apache.bookkeeper.mledger.impl.ManagedCursorTest.testOpReadEntryRecycle(ManagedCursorTest.java:3772)
   [3202](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3203)
   	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
   [3203](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3204)
   	at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:45)
   [3204](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3205)
   	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:73)
   [3205](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3206)
   	at org.testng.internal.InvokeMethodRunnable.call(InvokeMethodRunnable.java:11)
   [3206](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3207)
   	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   [3207](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3208)
   	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   [3208](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3209)
   	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   [3209](https://github.com/apache/pulsar/runs/7358126340?check_suite_focus=true#step:8:3210)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   ```
   
   ### Modification
   
   - Use `PowerMockito` to support it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] codelipenghui merged pull request #16628: [branch-2.9] Fix `MockStatic` method caused the exception

Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #16628:
URL: https://github.com/apache/pulsar/pull/16628


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org