org.springframework.test.web.servlet.htmlunit.geb
Class GebSpecTestExecutionListener
java.lang.Object
org.springframework.test.context.support.AbstractTestExecutionListener
org.springframework.test.web.servlet.htmlunit.geb.GebSpecTestExecutionListener
- All Implemented Interfaces:
- org.springframework.test.context.TestExecutionListener
public class GebSpecTestExecutionListener
- extends org.springframework.test.context.support.AbstractTestExecutionListener
A TestExecutionListener
that is intended to automatically inject a MockMvcHtmlUnitDriver
instance in
subclasses of GebSpec.
To use it ensure that you have the Spock Spring integration jar on your classpath and then update your test to look
something like this:
@ContextConfiguration(locations = ["file:src/main/webapp/WEB-INF/message-servlet.xml","file:src/main/webapp/WEB-INF/spring/*.xml"],
loader = WebContextLoader)
@TestExecutionListeners([ DependencyInjectionTestExecutionListener,
DirtiesContextTestExecutionListener,
TransactionalTestExecutionListener,
GebSpecTestExecutionListener])
class MockMvcCreateMessagesTest extends GebReportingSpec
- Author:
- Rob Winch
Method Summary |
void |
prepareTestInstance(org.springframework.test.context.TestContext testContext)
|
Methods inherited from class org.springframework.test.context.support.AbstractTestExecutionListener |
afterTestClass, afterTestMethod, beforeTestClass, beforeTestMethod |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GebSpecTestExecutionListener
public GebSpecTestExecutionListener()
prepareTestInstance
public void prepareTestInstance(org.springframework.test.context.TestContext testContext)
throws java.lang.Exception
- Specified by:
prepareTestInstance
in interface org.springframework.test.context.TestExecutionListener
- Overrides:
prepareTestInstance
in class org.springframework.test.context.support.AbstractTestExecutionListener
- Throws:
java.lang.Exception