Skip to content

Commit b9b51ad

Browse files
Disable Objenesis cache using a custom MockitoConfiguration
1 parent 143c8fa commit b9b51ad

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.mockito.configuration;
2+
3+
// The presence of this class configures Mockito to disable the Objenesis cache.
4+
// Caching causes problems when we dynamically replace classes in meta tests.
5+
6+
@SuppressWarnings("unused")
7+
public class MockitoConfiguration extends DefaultMockitoConfiguration {
8+
@Override
9+
public boolean enableClassCache() {
10+
return false;
11+
}
12+
}

0 commit comments

Comments
 (0)