How to write a junit for activate and deactivate method? | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sachin_Arora_

Please refer this document :
https://sling.apache.org/documentation/development/osgi-mock.html#activation-and-dependency-injection

// activate service

MockOsgi.activate(service, props);

 // deactivate service

MockOsgi.deactivate(service);

1 reply

Sachin_Arora_
Community Advisor
Sachin_Arora_Community AdvisorAccepted solution
Community Advisor
July 6, 2022

Please refer this document :
https://sling.apache.org/documentation/development/osgi-mock.html#activation-and-dependency-injection

// activate service

MockOsgi.activate(service, props);

 // deactivate service

MockOsgi.deactivate(service);