use of org.apache.sling.commons.classloader.DynamicClassLoaderManager in project acs-aem-commons by Adobe-Consulting-Services.
the class EntryNodeMapVisitorTest method getMockedNodeMapVisitor.
private EntryNodeMapVisitor getMockedNodeMapVisitor() throws Exception {
final DynamicClassLoaderManager dclm = mock(DynamicClassLoaderManager.class);
final EntryNodeMapVisitor visitor = new EntryNodeMapVisitor(11, dclm);
final EntryNodeMapVisitor spy = spy(visitor);
when(spy, "getCacheContent", any(Node.class)).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
return generateRandomCacheContent();
}
});
when(spy, "getCacheKey", any(Node.class)).thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocationOnMock) throws Throwable {
return generateRandomCacheKey();
}
});
return spy;
}
Aggregations