Expand my Community achievements bar.

Introducing Adobe LLM Optimizer: Own your brand’s presence in AI-Powered search and discovery

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);