Groovy Documentation

grails.test.mixin.services
[Groovy] Class ServiceUnitTestMixin

java.lang.Object
  grails.test.mixin.support.GrailsUnitTestMixin
      grails.test.mixin.services.ServiceUnitTestMixin

class ServiceUnitTestMixin
extends GrailsUnitTestMixin

A mixin that provides mocking capability for services.

Authors:
Graeme Rocher
Since:
2.0


Method Summary
java.lang.Object mockService(java.lang.Class serviceClass)

Mocks a service class, registering it with the application context

java.lang.Object testFor(java.lang.Class serviceClass)

Mocks a service class, registering it with the application context

 
Methods inherited from class GrailsUnitTestMixin
cleanupModifiedMetaClasses, defineBeans, deregisterMetaClassCleaner, initGrailsApplication, mockCodec, mockFor, mockForConstraintsTests, registerMetaClassRegistryWatcher, resetGrailsApplication, shouldFail, shouldFail, shutdownApplicationContext
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

mockService

java.lang.Object mockService(java.lang.Class serviceClass)
Mocks a service class, registering it with the application context
Parameters:
serviceClass - The service class
Returns:
An instance of the service


testFor

java.lang.Object testFor(java.lang.Class serviceClass)
Mocks a service class, registering it with the application context
Parameters:
serviceClass - The service class
Returns:
An instance of the service


 

Groovy Documentation