>>>>> "'Achim Nierbeck' via OPS4J" <[email protected]>:
> 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. Yes, I figured that out. This is also what the bug https://ops4j1.jira.com/browse/PAXEXAM-274 says. > 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. The integration test is to be: 1. Capture a Servlet OSGi service with a pax exam Inject 2. Do a GET request on the servlet, passing in a request and a response object, what I get back isn't interesting, I just want to decode enough to make an assert that what I get back is what I expect I was trying to use mockito to create the request and response objects, and that failed. Right now I'm running with hand-made "mocks": 1. Create a class MockHttpServletRequestBase that implements all methods of the HttpServletRequest interface 2. Create a class MockHttpServletRequest that extends MockHttpServletRequestBase and make real implementations of the interesting methods 3. Did the same thing for the HttpServletResponse interface (ie. created Mock*Base class and extended it with a Mock* class) -- -- ------------------ 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.
