Solved
JUnit - Page model NullPointerException
Hi All,
Trying to get Page model object (OOB) in JUnit test case, but getting NullPointerException (at line#75).
Am I missing anything in the implementation, any thoughts/suggestion please
.
Hi All,
Trying to get Page model object (OOB) in JUnit test case, but getting NullPointerException (at line#75).
Am I missing anything in the implementation, any thoughts/suggestion please
.
Try again after making your Sling Model more simple. Change to :
@Model(adaptables = {
SlingHttpServletRequest.class,
Resource.class
}, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class PageModel implements Page {
}If this doesn't work, try to remove implements Page. Just seeing it your developer's environment is working at all. It might just be a coding convention issue.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.