I running a unit test in grails service, but in the code i have a refresh gorm call, broke unit test.
Unit test
def unitMeasureMock = mockFor(UnitMeasure)
unitMeasureMock.demand.static.get() { Long id -> unit }
unitMeasureMock.demand.static.refresh(){unit}
In service code
UnitMeasure netWeightPalletUnitMeasure = UnitMeasure.get(pallet.netWeightPalletUnitMeasure.id)
netWeightPalletUnitMeasure.refresh()
The mock for refresh method doesn´t work.
How i mock gorm refresh method correctly?
Aucun commentaire:
Enregistrer un commentaire