Skip to content

Commit be1db98

Browse files
committed
enable debug level by default, use ModelFactory instead adapt to get more information about the failure
1 parent 4ab1514 commit be1db98

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<sling.starter.version>14-SNAPSHOT</sling.starter.version>
4646
<starter.min.bundles.count>200</starter.min.bundles.count>
4747
<it.startTimeoutSeconds>60</it.startTimeoutSeconds>
48-
<it.models.log.level>info</it.models.log.level>
48+
<it.models.log.level>debug</it.models.log.level>
4949
</properties>
5050

5151
<dependencies>

src/test/java/org/apache/sling/models/it/testing/InjectorSpecificAnnotationIT.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.sling.api.resource.ResourceResolver;
2727
import org.apache.sling.api.resource.ResourceResolverFactory;
2828
import org.apache.sling.junit.rules.TeleporterRule;
29+
import org.apache.sling.models.factory.ModelFactory;
2930
import org.apache.sling.models.it.testbundle.models.SlingPropertyAnnotationTestModel;
3031
import org.junit.Rule;
3132
import org.junit.Test;
@@ -56,7 +57,9 @@ public void test() throws Exception {
5657

5758
Resource resource = resolver.getResource(createdNode.getPath());
5859

59-
SlingPropertyAnnotationTestModel model = resource.adaptTo(SlingPropertyAnnotationTestModel.class);
60+
ModelFactory modelFactory = teleporter.getService(ModelFactory.class);
61+
SlingPropertyAnnotationTestModel model =
62+
modelFactory.createModel(resource, SlingPropertyAnnotationTestModel.class);
6063

6164
assertNotNull("Model is null", model);
6265
assertEquals("Test Property is not set correctly", value, model.getTestProperty());

0 commit comments

Comments
 (0)