[comixed-dev] Re: Upgrading to Java12 for 0.7

  • From: "Darryl L. Pierce" <mcpierce@xxxxxxxxx>
  • To: comixed-dev@xxxxxxxxxxxxx
  • Date: Sat, 13 Jun 2020 12:32:21 -0400

I ended up removing the testing of static methods in the JUnit tests and
wrapped the calls in our Utils class. That way I was able to just use
Mockito directly in those tests. What a PITA.

On Sat, Jun 13, 2020 at 9:35 AM Darryl L. Pierce <mcpierce@xxxxxxxxx> wrote:

Correction: this appears to be an issue with PowerMockito rather than
Mockito.

On Sat, Jun 13, 2020 at 9:16 AM Darryl L. Pierce <mcpierce@xxxxxxxxx>
wrote:

I started working on this issue today since, by the time 0.7 will get
released, Github is dropping support for building artifacts with Java8. So
it's pretty import to get this done before we do any more coding in Java.

I'm hitting an issue, though, with Mockito 3.3.3 in the comixed-services
module. Specifically I"m seeing, when running the JUnit test suite for
LibraryService, the following runtime error:

java.lang.NoClassDefFoundError: Could not initialize class
org.comixed.service.library.ReadingListService$MockitoMock$1837613629

at
jdk.internal.reflect.GeneratedSerializationConstructorAccessor5.newInstance(Unknown
Source)
at
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at
org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:48)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)

And I'm not sure exactly why it's doing this. The class is says it can't
find (ReadingListService) is in the same package as the test class and the
class being tested.

Has anybody else seen this issue? Do you know the fix for it?

--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie



--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie



-- 
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." - Gord
Downie

Other related posts: