Expand my Community achievements bar.

federicov798870
federicov798870
Offline
Type
  • All
  • Questions
  • Discussions
  • Ideas
  • Blogs
Filter by user contributions
  • Hi @milind_bachani ,thank you for your reply.I'am looking for a solution in which I don't need to perform resource setter by my hand.If you take the same code that you have posted, and you remove this line:"simpleModel.currentResource = resource;" and change the @Inject annotation with @SlingObject ...

    Type

    Questions

    Views

    3.7K

    Like

    1

    Replies

    14
  • Hi,If you have defined the select like this:<icon jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/select" name="./icon" fieldLabel="Show Icon"> <items jcr:primaryType="nt:unstructured"> <hide jcr:primaryType="nt:unstructured" t...

    Type

    Questions

    Views

    713

    Like

    1

    Replies

    0
  • Hi all,I’am facing an issue regarding the handling of the @inject annotation with AEM-Junit test scenario.Here an example of the issue:Model Class: @Model(adaptables = {SlingHttpServletRequest.class}, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL) public class SimpleModel { @inj...

    Type

    Questions

    Views

    4.1K

    Likes

    0

    Replies

    23
  • Thank you, but my problem is related on the adaptation of the Resource to "SimpleModel" in a test scenario.In my SimpleModel, I perfom the injection of the currentResource via @inject annotation, butwhen I try to test it, the currentResource injected is null and therefore my test fails (simpleModel ...

    Type

    Discussions

    Views

    1.4K

    Likes

    2

    Replies

    0
  • Thank you for your reply, but it doesn't seem to work since I received the same result.Below the code that I have tried:context.load().json("SimpleModelTest.json", "/content/myproject/us");currentResource = context.resourceResolver().getResource("/content/myproject/us/jcr:content/simple-component");...

    Type

    Discussions

    Views

    1.4K

    Like

    1

    Replies

    2
  • Hi all,I have many Sling Models and I need to create a JUnit test for them, but I'am not able to deal with the @inject  annotation.Here a simple example:Sling Model:import lombok.Getter;import org.apache.sling.api.SlingHttpServletRequest;import org.apache.sling.api.resource.Resource;import org.apach...

    Type

    Discussions

    Views

    1.4K

    Likes

    0

    Replies

    4
Top badges earned by federicov798870
Customize the badges you want to showcase on your profile