[Closed] (MNG-6472) Mockito cannot mock this class: interface org.eclipse.aether.impl.RepositoryEventDispatcher

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Closed] (MNG-6472) Mockito cannot mock this class: interface org.eclipse.aether.impl.RepositoryEventDispatcher

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/MNG-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylwester Lachiewicz closed MNG-6472.
-------------------------------------
    Resolution: Fixed

> Mockito cannot mock this class: interface org.eclipse.aether.impl.RepositoryEventDispatcher
> -------------------------------------------------------------------------------------------
>
>                 Key: MNG-6472
>                 URL: https://issues.apache.org/jira/browse/MNG-6472
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.5.4
>         Environment: Java 11
>            Reporter: Sylwester Lachiewicz
>            Assignee: Sylwester Lachiewicz
>            Priority: Minor
>             Fix For: 3.6.0
>
>
> Failed org.apache.maven.repository.internal.DefaultArtifactDescriptorReaderTest test under Java 11 with error:
> {code:java}
> 109970 [ERROR] org.apache.maven.plugin.surefire.SurefirePlugin - Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.208 s <<< FAILURE! - in org.apache.maven.repository.internal.DefaultArtifactDescriptorReaderTest
> 110004 [ERROR] org.apache.maven.plugin.surefire.SurefirePlugin - testMng5459(org.apache.maven.repository.internal.DefaultArtifactDescriptorReaderTest) Time elapsed: 2.118 s <<< ERROR!
> org.mockito.exceptions.base.MockitoException:
> Mockito cannot mock this class: interface org.eclipse.aether.impl.RepositoryEventDispatcher.
> Mockito can only mock non-private & non-final classes.
> If you're not sure why you're getting this error, please report to the mailing list.
> Java : 11
> JVM vendor name : Azul Systems, Inc.
> JVM vendor version : 11-ea+22
> JVM name : OpenJDK 64-Bit Server VM
> JVM version : 11-ea+22
> JVM info : mixed mode
> OS name : Windows 10
> OS version : 10.0
> Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
> at org.apache.maven.repository.internal.DefaultArtifactDescriptorReaderTest.testMng5459(DefaultArtifactDescriptorReaderTest.java:43)
> Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
> at org.apache.maven.repository.internal.DefaultArtifactDescriptorReaderTest.testMng5459(DefaultArtifactDescriptorReaderTest.java:43)
> Caused by: java.lang.IllegalStateException: Could not find sun.misc.Unsafe
> at org.apache.maven.repository.internal.DefaultArtifactDescriptorReaderTest.testMng5459(DefaultArtifactDescriptorReaderTest.java:43)
> Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
> at org.apache.maven.repository.internal.DefaultArtifactDescriptorReaderTest.testMng5459(DefaultArtifactDescriptorReaderTest.java:43)
> {code}
>  
> Update the Mockito to latest version 2.21.0 can solve the issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)