adamcin commented on PR #31:
URL: 
https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/31#issuecomment-1759672317

   > can you come up with a small code snipped how this would look in the unit 
test as example how you envision this?
   
   @stefanseifert Like this:
   
   ```java
   @ExtendWith(OsgiConfigParametersExtension.class)
   @AutoConfig(MyService.class)
   class MyServiceTest {
   
       public final OsgiContext context = new OsgiContext();
   
       @Test
       @MyService.Config
       void testGetPathDefault() {
           MyService service = 
context.registerInjectActivateService(MyService.class);
           assertEquals("/libs", service.getPath());
       }
   
       @Test
       @MyService.Config(path = "/apps") 
       void testGetPathApps() {
           MyService service = 
context.registerInjectActivateService(MyService.class);
           assertEquals("/apps", service.getPath());
       }
   
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to