I have added all the pom dependency with Junit, WCM io, Sling Jcr dependency.But still when i am running junit the below error is throwing when resource is adopting to page or node.
java.lang.NoSuchMethodError: org.osgi.framework.BundleContext.getServiceReference(Ljava/lang/Class;)Lorg/osgi/framework/ServiceReference;
at org.apache.sling.testing.mock.sling.ThreadsafeMockAdapterManagerWrapper$AdapterManagerBundleContextFactory.getAdapterManager(ThreadsafeMockAdapterManagerWrapper.java:90)
at org.apache.sling.testing.mock.sling.ThreadsafeMockAdapterManagerWrapper.getAdapter(ThreadsafeMockAdapterManagerWrapper.java:45)
at org.apache.sling.api.adapter.SlingAdaptable.adaptTo(SlingAdaptable.java:104).
What could the reason for this exception.