mockspresso-extend / com.episode6.hackit.mockspresso.extend

Package com.episode6.hackit.mockspresso.extend

Types

AbstractMockspressoExtension

abstract class AbstractMockspressoExtension<BLDR : MockspressoExtension.Builder<MockspressoExtension<*>!, MockspressoExtension.Rule<*>!, MockspressoExtension.Builder<*, *, *>!>!> : MockspressoExtension<BLDR>

Extend these 3 classes to create your own mockspresso extension AbstractMockspressoExtension AbstractMockspressoExtension.Rule AbstractMockspressoExtension.Builder In each subclass, point the generic type references to your interface extensions of MockspressoExtension and its inner interfaces. Each subclass should also directly implement the appropriate interface extension of MockspressoExtension In the subclass of AbstractMockspressoExtension, you should only need to override the constructor, providing a lambda that wraps Mockspresso.Builder with your custom subclass of AbstractMockspressoExtension.Builder

MockspressoExtension

interface MockspressoExtension<BLDR : MockspressoExtension.Builder<MockspressoExtension<*>!, MockspressoExtension.Rule<*>!, MockspressoExtension.Builder<*, *, *>!>!> : Mockspresso

Extend these 3 interfaces to build your own Mockspresso extension and own your api. MockspressoExtension MockspressoExtension.Rule MockspressoExtension.Builder Each interface/class is generically typed which is what allows you to extend them whithout needing to override all the default methods. Note: if you're working in a 100% kotlin codebase, this is totally unnecessary and you're better off simply adding extension methods to Mockspresso.Builder. These interfaces/abstract classes are only needed for java. Usually you will only want to add custom methods to your extension of MockspressoExtension.Builder