Java Reference
In-Depth Information
then:
seatType.getId() != null
}
}
You can notice a few differences. First of all, it's really Groovy! Secondly, the test uses a
different runner,
ArquillianSputnik
. What's more, you can already notice some
Spock DSL here, such as the
given
,
when
, and
then
constructions, which come from
behavior-driven development
(
BDD
). The
given
construction is expected to put the sys-
tem in a specific state,
when
describes an action, and
then
contains assertions that verify
the outcome of an action performed.
This fully working Spock example with the complete
pom.xml
configuration can be
found in this chapter's example project
named ticket-agency-spock
. More in-
formation concerning the Arquillian Spock test runner, its features, and usage instructions
can be found on GitHub at
https://github.com/arquillian/arquillian-testrunner-spock
. More
information concerning Spock can also be found on GitHub at
https://github.com/spock-