java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

Tests failing on examples folder

Open rochabr opened this issue 1 year ago • 2 comments

Expected Behavior

Tests should run and pass.

Actual Behavior

After running mvn install the following exceptions occur:

[ERROR] Failures: 
[ERROR]   DaprClientBuilderTest.blankContentTypeInObjectSerializer:61 Unexpected exception type thrown ==> expected: <java.lang.IllegalArgumentException> but was: <java.lang.IllegalStateException>
[ERROR]   DaprClientBuilderTest.buildWithOverrideSidecarIP:50 expected: <true> but was: <false>
.
.
.
[ERROR]   DaprRuntimeTest.invokeHappyCase:149 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
[ERROR]   DaprRuntimeTest.pubSubHappyCase:80 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
[ERROR]   DaprRuntimeTest.subscribeCallbackException:236 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
[ERROR]   DaprRuntimeTest.subscribeUnknownTopic:269 » IllegalState Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
[INFO] 
[ERROR] Tests run: 292, Failures: 2, Errors: 141, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] dapr-sdk-parent 1.13.0-SNAPSHOT .................... SUCCESS [  2.267 s]
[INFO] dapr-sdk-autogen 1.13.0-SNAPSHOT ................... SUCCESS [ 13.359 s]
[INFO] dapr-sdk 1.13.0-SNAPSHOT ........................... FAILURE [ 16.788 s]
[INFO] dapr-sdk-actors 1.13.0-SNAPSHOT .................... SKIPPED
[INFO] dapr-sdk-workflows 0.13.0-SNAPSHOT ................. SKIPPED
[INFO] dapr-sdk-springboot 1.13.0-SNAPSHOT ................ SKIPPED
[INFO] dapr-sdk-examples 1.13.0-SNAPSHOT .................. SKIPPED
[INFO] testcontainers-dapr 0.13.0-SNAPSHOT ................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Steps to Reproduce the Problem

1 - Follow the tutorial on https://github.com/dapr/java-sdk/tree/master/examples 2 - After running the mvn install step see the exceptions

Release Note

Dapr CLI version: 1.14.1 Dapr Runtime version: 1.14.1 Java version: 22.0.2 Maven version: 3.9.8

rochabr avatar Aug 26 '24 02:08 rochabr

@rochabr thanks a lot for raising this issue. I was wondering you could try a few things:

  • Install SDKMan - Dapr Java SDK relies on SDKMan for its development, to make sure we use the right version on JDK
  • Use SDKMan to setup local env - once you have SDKMan you can executed $ sdkman env to make sure the right version of JDK is installed and added to the PATH
  • Use Maven Wrapper - Dapr Java SDK repo uses Maven Wrapper. Could you try using $ ./mvnw clean install instead of $ mvn install.

If after all these steps you will still run into issues then we will have to dig deeper. If everything will work out, I will make sure to adjust the docs and add references to SDKMan and Maven Wrapper.

CC: @artursouza @cicoyle

artur-ciocanu avatar Aug 31 '24 11:08 artur-ciocanu

@rochabr could you please let us know if you are still running into issues or we can close this issue.

Thank you 🙇

artur-ciocanu avatar Sep 23 '24 11:09 artur-ciocanu