eventmesh
eventmesh copied to clipboard
[Enhancement] Add test code for this module [eventmesh-runtime]
Search before asking
- [X] I had searched in the issues and found no similar issues.
Enhancement Request
Add test code for eventmesh-runtime module.
Describe the solution you'd like
Module name: eventmesh-runtime Located in: eventmesh-runtime Task status: ×(unfinished) / √(finished)
Notes: The following classes are only a part of this module. If you want to do some unit tests for this module, you can select some classes in this module for unit testing, but please submit a detailed issue separately and linked to the pr you submitted, because this issue will not be deleted.
Task Status | Class | Type |
---|---|---|
× | org/apache/eventmesh/runtime/util/EventMeshThreadFactoryImpl.java | utils |
× | org/apache/eventmesh/runtime/util/EventMeshUtil.java | utils |
× | org/apache/eventmesh/runtime/util/HttpTinyClient.java | utils |
× | org/apache/eventmesh/runtime/util/IOTinyUtils.java | utils |
× | org/apache/eventmesh/runtime/util/NetUtils.java | utils |
× | org/apache/eventmesh/runtime/util/RemotingHelper.java | utils |
× | org/apache/eventmesh/runtime/util/WebhookUtil.java | utils |
× | org/apache/eventmesh/runtime/admin/controller/ClientManageController.java | controller |
× | org/apache/eventmesh/runtime/admin/handler/QueryRecommendEventMeshHandler.java | handler |
× | org/apache/eventmesh/runtime/admin/handler/RedirectClientByPathHandler.java | handler |
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Please assign to me. I'll try to work on this.
@walterlife you can reopen a new sub-issue and work on it, this issue will open until the code coverage up to 100%.
Can i work on this?
Please assign me I would like to work on this issue.
Any progress with this issue? I would like to tackle.
@arsenalzp You may add missing unit tests under the runtime module.
@arsenalzp You may add missing unit tests under the runtime module.
Hello, I took some unit tests, however I guess my project was not configured properly because even already merged unit tests code failed with error:
Run the test:
gradle test --tests org.apache.eventmesh.runtime.admin.handler.QueryRecommendEventMeshHandlerTest
Output:
org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class org.apache.eventmesh.runtime.boot.EventMeshTCPServer.
If you're not sure why you're getting this error, please report to the mailing list.
Java : 17
JVM vendor name : Red Hat, Inc.
JVM vendor version : 17.0.8+7
JVM name : OpenJDK 64-Bit Server VM
JVM version : 17.0.8+7
JVM info : mixed mode, sharing
OS name : Linux
OS version : 6.2.15-200.fc37.x86_64
You are seeing this disclaimer because Mockito is configured to create inlined mocks.
You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.
> Task :eventmesh-runtime:test
QueryRecommendEventMeshHandlerTest > testHandle() FAILED
org.mockito.exceptions.base.MockitoException at QueryRecommendEventMeshHandlerTest.java:52
Caused by: org.mockito.exceptions.base.MockitoException at QueryRecommendEventMeshHandlerTest.java:52
Caused by: java.lang.IllegalStateException at QueryRecommendEventMeshHandlerTest.java:52
Caused by: java.lang.IllegalArgumentException at QueryRecommendEventMeshHandlerTest.java:52
@arsenalzp
JVM version : 17.0.8+7
Please retry using JDK8. If you're still encountering problems, it may be a potential bug and it's welcome to fix it.
@arsenalzp
JVM version : 17.0.8+7
Please retry using JDK8. If you're still encountering problems, it may be a potential bug and it's welcome to fix it.
Hello, You were right, the issue fixed by using OpenJSK 8