Its been a while since im struggling with this, so i decided to post the question here.
What I wanna do its just create some unit tests for my rest services. Im not having a specific error, given i changed my implementations thousands of times, thats why im not showing any code here.
Im using Apache Felix as OSGI implementation so I would like to load the beans definitions in my unit test and mock some of them. Im not sure which should be the service container, so any example is welcome.
Thanks in advance
Here is one: https://github.com/everit-org/osgi-remote-jersey
See the readme for details, how the extender works.
Tests are placed into the tests module. If we run "mvn install", first an equinox than a felix environment is started with a random jetty port. The tests run on these OSGi containers.
If you want to check the content of the container, you can
If you opened the modules in eclipse as a maven project, you can Drag&Drop your projects from Eclipse project explorer to the always-on-top deployer window that appears after the container is started.
If you add/remove dependencies in the tests, you can