Hey Robbert, Aha okey that explains it, I'm still on the 1.x branch for now! I will have to wait until I can do an upgrade to the new sling api, or maybe backport the functionality, thanks!
Greets Roy > Op 21 dec. 2016 om 08:49 heeft Robert Munteanu <romb...@apache.org> het > volgende geschreven: > > Hi Roy, > >> On Tue, 2016-12-20 at 23:03 +0100, Roy Teeuwen wrote: >> Hey all, >> >> I am trying to use the osgi mocks in the following setup: >> @Component >> @Designate(ocd = ServiceImpl.Config.class) >> public class ServiceImpl implements Service { >> >> @ObjectClassDefinition >> @interface Config { >> >> String property() default "value"; >> } >> >> private Config config; >> >> @Activate >> public void activate(Config config) { >> this.config = config; >> } >> } >> Test class: >> service = context.registerInjectActivateService(new ServiceImpl(), >> "property", "some-value"); >> But I am getting the following exception: >> >> java.lang.RuntimeException: No matching activation method with name >> 'activate' found in class some.packagename.ServiceImpl > > (snip) > > Support for annotation classes as configuration was added with > > https://issues.apache.org/jira/browse/SLING-5327 > > which is part of OSGi Mocks 2.0.0 . What version are you using? > > Robert