use of org.apache.sling.api.resource.ResourceResolverFactory in project sling by apache.
the class ScriptingResourceResolverProviderImplTest method setUp.
@Before
public void setUp() throws LoginException {
delegates = Collections.synchronizedSet(new HashSet<ResourceResolver>());
ResourceResolverFactory rrf = mock(ResourceResolverFactory.class);
when(rrf.getServiceResourceResolver(null)).thenAnswer(new Answer<ResourceResolver>() {
@Override
public ResourceResolver answer(InvocationOnMock invocation) throws Throwable {
ResourceResolver delegate = getMockedRR();
delegates.add(delegate);
return delegate;
}
});
scriptingResourceResolverFactory = new ScriptingResourceResolverProviderImpl();
Whitebox.setInternalState(scriptingResourceResolverFactory, "rrf", rrf);
}
Aggregations