Hi Guys,
I am trying to use wcm.io tool for Junit testing but its not working for me getting error:
java.lang.RuntimeException: Unable to invoke method 'bindInjector' for class org.apache.sling.models.impl.ModelAdapterFactory
I have used this code:
@RunWith(MockitoJUnitRunner.class)
public class MyDictionaryTest {
@Rule
public final AemContext context = new AemContext();
@BeforeClass
public static void beforeClass(){
System.out.println("Before Class");
}
@Before
public void before(){
System.out.println("Before Test Case");
}
@Test
public void isGreaterTest(){
System.out.println("Test");
MyDictionary helloWorld = new MyDictionary();
assertTrue("Num 1 is greater than Num 2" , helloWorld.isGreater(5, 3));
}
@After
public void after(){
System.out.println("After Test Case");
}
public void afterClass(){
System.out.println("After Class");
}
}
Kindly help me to resolve it
Thanks
meenal
Solved! Go to Solution.
Views
Replies
Total Likes
Have a look at the core-components, we have unit-tests are in there: GitHub - Adobe-Marketing-Cloud/aem-core-wcm-components: AEM Core WCM Components
Views
Replies
Total Likes
Here is a GEMS session on this subject that you may find helpful: From Unit Testing to Integration Test of an AEM Application
Views
Replies
Total Likes
Have a look at the core-components, we have unit-tests are in there: GitHub - Adobe-Marketing-Cloud/aem-core-wcm-components: AEM Core WCM Components
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies