Package org.mockserver.matchers
Class CustomJsonUnitMatcherLoader
- java.lang.Object
-
- org.mockserver.matchers.CustomJsonUnitMatcherLoader
-
public final class CustomJsonUnitMatcherLoader extends Object
Loads theCustomJsonUnitMatcherProviderclass named bymockserver.customJsonUnitMatchersClassand exposes the matchers it produces.The provider class is instantiated once via its public no-arg constructor and its matcher map is cached for the JVM lifetime keyed on the class name, so changing the configuration property at runtime (e.g. between tests) picks up the new provider on next access.
If the property is blank, the named class cannot be loaded, the class does not implement
CustomJsonUnitMatcherProvider, or any exception is thrown during instantiation, an empty map is returned and a WARN log entry is written - matching is never failed because of a misconfigured provider.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,org.hamcrest.Matcher<?>>load()Returns the named matchers contributed by the configured provider, or an empty map if no provider is configured or the provider cannot be loaded.static voidreset()Clears the cached provider so the next call toload()re-reads the configuration property and re-instantiates the provider.
-
-
-
Method Detail
-
load
public static Map<String,org.hamcrest.Matcher<?>> load()
Returns the named matchers contributed by the configured provider, or an empty map if no provider is configured or the provider cannot be loaded.
-
reset
public static void reset()
Clears the cached provider so the next call toload()re-reads the configuration property and re-instantiates the provider. Intended for tests that change the property between cases.
-
-