breeze0812 commented on issue #3568:
URL:
https://github.com/apache/incubator-dolphinscheduler/issues/3568#issuecomment-678061421
After looking at some of the data, I added the annotation
`@PowermockIgnore ({"javax.management.* "})`
in the test case header, and the error message changed to:
`14:07:01.963 [main] INFO
org.apache.dolphinscheduler.api.service.DataSourceService - parameters
map:{"type":null,"address":"jdbc:postgresql://172.16.133.200:5432","database":"dolphinscheduler","jdbcUrl":"jdbc:postgresql://172.16.133.200:5432/dolphinscheduler","user":"postgres","password":""}
14:07:02.153 [main] INFO ru.yandex.clickhouse.ClickHouseDriver - Driver
registered
org.mockito.exceptions.misusing.MissingMethodInvocationException:
when() requires an argument which has to be 'a method call on a mock'.
For example:
when(mock.getArticles()).thenReturn(articles);
Also, this error might show up because:
1. you stub either of: final/private/equals()/hashCode() methods.
Those methods *cannot* be stubbed/verified.
Mocking methods declared on non-public parent classes is not supported.
2. inside when() you don't call method on mock but on some other object.
at
org.apache.dolphinscheduler.api.service.DataSourceServiceTest.createDataSourceTest(DataSourceServiceTest.java:78)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:68)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:89)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:97)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:50)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at
com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)`
Can someone help me see what the problem is? thxs
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]