Class ClassPathLoader
java.lang.Object
org.mockito.internal.configuration.ClassPathLoader
Loads configuration or extension points available in the classpath.
-
Can load the mockito configuration. The user who want to provide his own mockito configuration
should write the class
org.mockito.configuration.MockitoConfiguration
that implementsIMockitoConfiguration
. For example :package org.mockito.configuration; //... public class MockitoConfiguration implements IMockitoConfiguration { boolean enableClassCache() { return false; } // ... }
-
Can load available mockito extensions. Currently Mockito only have one extension point the
MockMaker
. This extension point allows a user to provide his own bytecode engine to build mocks.
Suppose you wrote an extension to create mocks with some Awesome library, in order to tell Mockito to use it you need to put in your classpath- The implementation itself, for example
org.awesome.mockito.AwesomeMockMaker
. - A file named
org.mockito.plugins.MockMaker
in a folder namedmockito-extensions
, the content of this file need to have one line with the qualified nameorg.awesome.mockito.AwesomeMockMaker
.
- The implementation itself, for example
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MOCKITO_CONFIGURATION_CLASS_NAME
- See Also:
-
-
Constructor Details
-
ClassPathLoader
public ClassPathLoader()
-
-
Method Details
-
loadConfiguration
- Returns:
- configuration loaded from classpath or null
-