-
public final class MockPrinterConfigurationSet configuration details for how mock state is generated.
-
-
Field Summary
Fields Modifier and Type Field Description private final Function1<Object, String>mockPackageprivate final List<TypePrinter<?>>customTypePrinters
-
Constructor Summary
Constructors Constructor Description MockPrinterConfiguration(Function1<Object, String> mockPackage, List<TypePrinter<?>> customTypePrinters)
-
Method Summary
Modifier and Type Method Description final Function1<Object, String>getMockPackage()Given a MavericksView that we are generating mock states for, returns which package name to use for the generated file. final List<TypePrinter<?>>getCustomTypePrinters()Define functions for generating code for a custom class. -
-
Constructor Detail
-
MockPrinterConfiguration
MockPrinterConfiguration(Function1<Object, String> mockPackage, List<TypePrinter<?>> customTypePrinters)
-
-
Method Detail
-
getMockPackage
final Function1<Object, String> getMockPackage()
Given a MavericksView that we are generating mock states for, returns which package name to use for the generated file.
By default mock states are place in a "mocks" subpackage within the package of the view it is mocking.
-
getCustomTypePrinters
final List<TypePrinter<?>> getCustomTypePrinters()
Define functions for generating code for a custom class.
This allows the mock printer to generate code to construct instances of a custom type. By default, primitive types, enums, collections, Kotlin 'object's, AutoValue classes, and Kotlin data classes are supported.
These are called in order. The first one to return true from TypePrinter.acceptsObject will be used, otherwise a default implementation will be used for the object.
-
-
-
-