This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-caconfig-mock-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 5eb36b1 SLING-11811 caconfig Mock Plugin: Register Sling Models
injector in beforeSetUp
5eb36b1 is described below
commit 5eb36b1ac6674360acbf74cc7aa6b12e7eb0dd84
Author: Stefan Seifert <[email protected]>
AuthorDate: Mon Mar 27 10:25:09 2023 +0200
SLING-11811 caconfig Mock Plugin: Register Sling Models injector in
beforeSetUp
---
.../org/apache/sling/testing/mock/caconfig/ContextPlugins.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git
a/src/main/java/org/apache/sling/testing/mock/caconfig/ContextPlugins.java
b/src/main/java/org/apache/sling/testing/mock/caconfig/ContextPlugins.java
index d5df0c0..01f2752 100644
--- a/src/main/java/org/apache/sling/testing/mock/caconfig/ContextPlugins.java
+++ b/src/main/java/org/apache/sling/testing/mock/caconfig/ContextPlugins.java
@@ -49,11 +49,16 @@ public final class ContextPlugins {
*/
public static final @NotNull ContextPlugin<? extends SlingContextImpl>
CACONFIG = new AbstractContextPlugin<SlingContextImpl>() {
@Override
- public void afterSetUp(@NotNull SlingContextImpl context) throws
Exception {
+ public void beforeSetUp(@NotNull SlingContextImpl context) throws
Exception {
+ // register models injector and it's dependencies before setup, to
ensure it is present
+ // before sling models are auto-detected from classpath
registerConfigurationResourceResolver(context);
registerConfigurationResolver(context);
registerConfigurationManagement(context);
registerModelsInjector(context);
+ }
+ @Override
+ public void afterSetUp(@NotNull SlingContextImpl context) throws
Exception {
registerConfigurationResourceResolverDefaultImpl(context);
registerConfigurationResolverDefaultImpl(context);