Skip to content

Commit

Permalink
Revert to Java 11, tests currently fail under Java 21
Browse files Browse the repository at this point in the history
The version of the mocking library Mockito that we're currently using does
not support Java 21, and so the tests currently fail under Java 21 with
`java.lang.NoClassDefFoundError`

```
[info] com.gu.facia.api.contentapi.ContentApiTest *** ABORTED ***
[info]   java.lang.NoClassDefFoundError: Could not initialize class org.mockito.internal.creation.cglib.ClassImposterizer$3
[info]   at org.mockito.internal.creation.cglib.ClassImposterizer.createProxyClass(ClassImposterizer.java:95)
[info]   at org.mockito.internal.creation.cglib.ClassImposterizer.imposterise(ClassImposterizer.java:57)
[info]   at org.mockito.internal.creation.cglib.ClassImposterizer.imposterise(ClassImposterizer.java:49)
[info]   at org.mockito.internal.creation.cglib.CglibMockMaker.createMock(CglibMockMaker.java:24)
[info]   at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:33)
[info]   at org.mockito.internal.MockitoCore.mock(MockitoCore.java:59)
[info]   at org.mockito.Mockito.mock(Mockito.java:1285)
[info]   at org.mockito.Mockito.mock(Mockito.java:1163)
[info]   at org.scalatestplus.mockito.MockitoSugar.mock(MockitoSugar.scala:73)
[info]   at org.scalatestplus.mockito.MockitoSugar.mock$(MockitoSugar.scala:72)
[info]   ...
[info]   Cause: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "pool-7-thread-11"]
[info]   at org.mockito.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:167)
[info]   at org.mockito.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
[info]   at org.mockito.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:217)
[info]   at org.mockito.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
[info]   at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:117)
[info]   at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:109)
[info]   at org.mockito.cglib.core.KeyFactory.create(KeyFactory.java:105)
[info]   at org.mockito.cglib.proxy.Enhancer.<clinit>(Enhancer.java:70)
[info]   at org.mockito.internal.creation.cglib.ClassImposterizer.createProxyClass(ClassImposterizer.java:95)
[info]   at org.mockito.internal.creation.cglib.ClassImposterizer.imposterise(ClassImposterizer.java:57)
[info]   ...
```
  • Loading branch information
rtyley committed Jul 12, 2024
1 parent 3690941 commit 6d74935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java corretto-21.0.3.9.1
java corretto-11.0.23.9.1

0 comments on commit 6d74935

Please sign in to comment.