CRUDTestMapper

interface CRUDTestMapper<I : Serializable, E : CRUDEntity<I, E>, M : CRUDModel<I>, CM : CRUDCreateModel, UM : CRUDUpdateModel>(source)

Mapper to convert between models and entities in tests

Parameters

I

Id type of the data

M

Model type of the data which is a CRUDModel

E

Entity type of the data which is a CRUDEntity

CM

Create model type of the data which is a CRUDCreateModel

UM

Update model type of the data which is a CRUDUpdateModel

Functions

Link copied to clipboard
abstract fun entityToCreateModel(entity: E): CM

Mapper to convert from given entity to create model

Link copied to clipboard
abstract fun entityToModelWithExpectedId(entity: E, expectedId: I): M

Mapper to convert from given entity to model replacing its id with given expected id