Skip to content

Integration test: Service classes

pschneider-manzell edited this page Dec 9, 2012 · 1 revision

Take a look at the BootStrap what objects are created in the DB before the the integration tests are started

Example for an integration test with Spock:

class GuttenbergServiceIntegrationSpec extends IntegrationSpec {

def guttenbergService
def "Create thesis for first author in DB"() {

	when:
	def thesis = guttenbergService.createThesis(authorId)

	then:
	thesis != null
	Book.countByAuthor(author) == 2

	where:
	authorId = 1L
	author = Author.get(authorId)
	}
}

Find more examples here:

  • GuttenbergServiceIntegrationSpec
Clone this wiki locally