Junit test fails in latest Eclipse | Community
Skip to main content
Level 4
April 24, 2022

Junit test fails in latest Eclipse

  • April 24, 2022
  • 1 reply
  • 1414 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

arunpatidar
Community Advisor
Community Advisor
April 25, 2022

Hi,

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

Arun Patidar
nbg62Author
Level 4
April 25, 2022

Triple checked everything...