Hi Steinar, afaik Mockito does some real nasty things on the classpath with reflection etc. That'll hurt to have it running on Pax Exam. You have to differ. Mockito is great with unit tests and it's where it belongs. Pax Exam is the foundation for your integration tests, and there you usually don't mock in that way. If you depend on external services that aren't available in your scenario, you'll need to create dummy services. But the main scope of Pax Exam is to make sure your wiring is correct and everything runs smoothly in an OSGi environment. If you want to test your method functionality you should stick to plain unit tests.
regards, Achim 2017-10-09 19:54 GMT+02:00 Steinar Bang <[email protected]>: > >>>>> Steinar Bang <[email protected]>: > > > The problem is similar to what was seen in this bug, 6 years ago > > https://ops4j1.jira.com/browse/PAXEXAM-274 > > > But the bug was 6 years ago, and many versions of everything (OSGi, > > pax-exam, mockito, Java) ago, so I'm not sure if the simiarlities are a > > red herring...? > > The more I looked at it, it looked similar. And the issue is still > open. > > So what I've done now is to ditch mockito from the integration test, and > just mock the response and request objects manually (create a base class > implementing the interface with default content created by the IDE, and > then extend that base class and actually implement the methods I > otherwise would have mocked). > > -- > -- > ------------------ > OPS4J - http://www.ops4j.org - [email protected] > > --- > You received this message because you are subscribed to the Google Groups > "OPS4J" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master -- -- ------------------ OPS4J - http://www.ops4j.org - [email protected] --- You received this message because you are subscribed to the Google Groups "OPS4J" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
