adamcin commented on code in PR #135: URL: https://github.com/apache/sling-site/pull/135#discussion_r1355177562
########## src/main/jbake/content/documentation/development/osgi-mock.md: ########## @@ -231,3 +235,192 @@ More examples: [mockito-junit5-extension]: https://www.javadoc.io/page/org.mockito/mockito-junit-jupiter/latest/org/mockito/junit/jupiter/MockitoExtension.html [caconfig-mock-plugin]: https://github.com/apache/sling-org-apache-sling-testing-caconfig-mock-plugin/blob/master/src/main/java/org/apache/sling/testing/mock/caconfig/ContextPlugins.java [caconfig-mock-plugin-test]: https://github.com/apache/sling-org-apache-sling-testing-caconfig-mock-plugin/blob/master/src/test/java/org/apache/sling/testing/mock/caconfig/ContextPluginsTest.java + +## Config Annotations + +Since osgi-mock 3.4.0, it is possible to use the provided `@UpdateConfig` and `@ApplyConfig` annotations to directly construct component property type ("Config") annotations for use as first-class values in unit tests. Both osgi-mock.junit4 and osgi-mock.junit5 provide different approaches for convenient reflection and injection of these annotations. Review Comment: @stefanseifert I've honestly had the hardest time naming the `@ApplyConfig` annotation throughout its development, so I'm still open to suggestions as long as that PR is open. My first choice was to call it `@ComponentPropertyType`, but this annotation is already defined by the OSGi spec for use as a marker annotation on the same config annotations I'm trying to construct, which would just invite confusion when one is accidentally used in place of the other. I also tried `@DynamicConfig` and `@ConfigMapping`, but I ultimately decided on `@ApplyConfig` when it became clear I should create a separate `@UpdateConfig` annotation. Maybe either `@GetConfig` or `@MapConfigType` would be better? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
