Skip to Content
4
Aug 03, 2022 at 08:44 AM

Issue on webtests with SAP Commerce 2205P1

1320 Views

We have an issue on our web tests with the newest 2205P1 Upgrade of SAP Commerce when running

ant allwebtests -Dtestclasses.suppress.junit.tenant=true


The tests are randomily failing due to an Mockito mocking error exceptions(see below). Running the same test again via the same ant command is then succeeding without any code change.

So the result of the tests is just random and not deterministic (sometimes they fail, sometimes not)

It might be due to some classpath issue? Was anything changed in the 2205P1 regarding that and tests? Running the same tests with no code change on 2205P0, all tests are always successful.

<code>java.lang.NoClassDefFoundError: Could not initialize class org.mockito.codegen.ReturnService$MockitoMock$1335712202
	at jdk.internal.reflect.GeneratedSerializationConstructorAccessor2.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:48)
	at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
	at org.mockito.internal.creation.instance.ObjenesisInstantiator.newInstance(ObjenesisInstantiator.java:22)
	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.doCreateMock(InlineDelegateByteBuddyMockMaker.java:372)
	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMock(InlineDelegateByteBuddyMockMaker.java:330)
	at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.createMock(InlineByteBuddyMockMaker.java:58)
	at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:53)
	at org.mockito.internal.MockitoCore.mock(MockitoCore.java:84)
	at org.mockito.Mockito.mock(Mockito.java:1954)