Expand my Community achievements bar.

Junit test fails in latest Eclipse

Avatar

Level 5

Running junit in the latest Eclipse (Eclipse IDE for Enterprise Java and Web Developers, version 2022-03 (4.23.0)) fails to adaptTo resource, instead it returns null.

Same test in the same workspace just in older Eclispe (Eclipse IDE for Enterprise Java Developers, 2019-03 (4.11.0)) executes test with no problem.

 

final SmallCarousel actual = ctx.request().adaptTo(SmallCarousel.class);

"actual" ends up to be null after execution of this line...

 

When debugging in older Eclipse I could see that MockAdapterManagerImpl.getAdapter returns factory for SmallCarousel in a call to, 

final Map<String, List<AdapterFactoryDescriptor>> factories = getAdapterFactories(adaptable.getClass());

 

Same Map in new Eclipse doesn't contain factory for SmallCarousel.

 

Thanks

2 Replies

Avatar

Community Advisor

Hi,

Can you check the jdk/jre and other settings in the new Eclipse?



Arun Patidar