File tree Expand file tree Collapse file tree
src/test/java/org/apache/sling/models/it/testing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 2626import org .apache .sling .api .resource .ResourceResolver ;
2727import org .apache .sling .api .resource .ResourceResolverFactory ;
2828import org .apache .sling .junit .rules .TeleporterRule ;
29+ import org .apache .sling .models .factory .ModelFactory ;
2930import org .apache .sling .models .it .testbundle .models .SlingPropertyAnnotationTestModel ;
3031import org .junit .Rule ;
3132import 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 ());
You can’t perform that action at this time.
0 commit comments