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