Hi everyone,
in my case I would like to register a mocked version of an osgi service -
in the past IIRC I could have scr metadata in a mock class under
src/test/java and just register this one.

With the more recent osgi annotations to generate the scr metadata there is
an extra execution for scr generation as described in
http://felix.apache.org/documentation/faqs/apache-felix-bundle-plugin-faq.html#use-scr-metadata-generated-by-bnd-in-unit-tests

The problem: this will ignore classes in scr-metadata so I currently see no
way on how to mock an osgi service for a test case without creating an own
bundle with these mocks (along with the generated SCR metadata).

Is there any way to programmatically inject a service and inject the
corresponding metadata?

Cheers
Dominik

Reply via email to