Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: re-enable and fix DeploymentAgentTest #5632

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

mattdibi
Copy link
Contributor

@mattdibi mattdibi commented Jan 7, 2025

In #5602 we disabled some tests that were failing due to the Java 17 change. This PR re-enables one of them.

We were getting the following error after switching to Java 17:

[ERROR] testRemovePackageToConfFile(org.eclipse.kura.deployment.agent.impl.DeploymentAgentTest)  Time elapsed: 1.299 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ConcurrentHashMap.entrySet()" because "this.map" is null
	at org.eclipse.kura.deployment.agent.impl.DeploymentAgentTest.testRemovePackageToConfFile(DeploymentAgentTest.java:507)

[ERROR] testAddPackageToConfFileStoreException(org.eclipse.kura.deployment.agent.impl.DeploymentAgentTest)  Time elapsed: 0.025 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ConcurrentHashMap.entrySet()" because "this.map" is null
	at org.eclipse.kura.deployment.agent.impl.DeploymentAgentTest.testAddPackageToConfFileStoreException(DeploymentAgentTest.java:421)

[ERROR] testRemovePackageToConfFileStoreException(org.eclipse.kura.deployment.agent.impl.DeploymentAgentTest)  Time elapsed: 0.025 s  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ConcurrentHashMap.entrySet()" because "this.map" is null
	at org.eclipse.kura.deployment.agent.impl.DeploymentAgentTest.testRemovePackageToConfFileStoreException(DeploymentAgentTest.java:476)

This seems to be an issue with Mockito and spying Threads as per:

As suggested in mockito/mockito#2628, switching to mockito-inline seems to fix it.


Note: there seems to be another issue with this same test suite related to mockserver. When running these tests we get:

java.lang.IllegalStateException: javax.security.cert.CertificateException: Could not find class: java.lang.ClassNotFoundException: com/sun/security/cert/internal/x509/X509V1CertImpl

which is related to mock-server/mockserver#1739.

This does not break our current tests because, even if it fails to decode the client certificate, it proceeds with the rest of the test anyway.

@mattdibi mattdibi marked this pull request as draft January 7, 2025 14:04
@mattdibi mattdibi marked this pull request as ready for review January 7, 2025 15:14
@mattdibi mattdibi force-pushed the test/fix_DeploymentAgentTest3 branch from 841a779 to 3024e9b Compare January 7, 2025 15:14
@pierantoniomerlino pierantoniomerlino merged commit 88a6ed1 into develop Jan 8, 2025
4 checks passed
@pierantoniomerlino pierantoniomerlino deleted the test/fix_DeploymentAgentTest3 branch January 8, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants