Expand my Community achievements bar.

Join expert-led, customer-led sessions on Adobe Experience Manager Assets on August 20th at our Skill Exchange.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

How to write a junit for activate and deactivate method?

Avatar

Level 1
 
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

// activate service

MockOsgi.activate(service, props);

 // deactivate service

MockOsgi.deactivate(service);

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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

// activate service

MockOsgi.activate(service, props);

 // deactivate service

MockOsgi.deactivate(service);