Package org.javalite.activeweb
Class IntegrationSpec
java.lang.Object
org.javalite.activeweb.SpecHelper
org.javalite.activeweb.RequestSpecHelper
org.javalite.activeweb.IntegrationSpec
- All Implemented Interfaces:
JSpecSupport
- Direct Known Subclasses:
AppIntegrationSpec
,DBIntegrationSpec
Use this as a super class for integration tests that do not require a DB connection.
An integration test allows to describe a scenario of actions that span multiple controllers.
- Author:
- Igor Polevoy
-
Nested Class Summary
Nested classes/interfaces inherited from class org.javalite.activeweb.SpecHelper
SpecHelper.DynamicBuilder, SpecHelper.ModuleBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFilter(Class<? extends AppController> controllerClass, HttpSupportFilter filter)
Adds a filter to a specific controller for the duration of the current spec.protected void
addFilter(HttpSupportFilter filter)
Adds a global filter for the duration of the current spec.protected RequestBuilder
controller(String controllerName)
protected void
Clears all filters from context even if they are defined in theAppControllerConfig
class.protected void
setTemplateLocation(String templateLocation)
Methods inherited from class org.javalite.activeweb.RequestSpecHelper
assigns, atStart00, bytesContent, contentType, cookie, cookieValue, count, getCookies, header, headerNames, headers, layout, redirected, redirectValue, responseContent, statusCode, template, text, val, val, valBoolean, valDouble, valFloat, valInteger, valLong, vals, valString
Methods inherited from class org.javalite.activeweb.SpecHelper
afterEnd, atStart, createInjector, flash, flash, flashExists, injector, registerTag, session, session, session, sessionBoolean, sessionDouble, sessionFloat, sessionHas, sessionInteger, sessionLong, sessionObject, sessionString, setInjector
-
Constructor Details
-
IntegrationSpec
public IntegrationSpec()
-
-
Method Details
-
resetFilters
protected void resetFilters()Clears all filters from context even if they are defined in theAppControllerConfig
class. This method allows to run integration specs cleanly, with filters specifically set byaddFilter(Class, HttpSupportFilter)
method. -
controller
-
setTemplateLocation
- Overrides:
setTemplateLocation
in classSpecHelper
- Parameters:
templateLocation
- this is a relative location starting from the module root, intended for testing.
-
addFilter
Adds a filter to a specific controller for the duration of the current spec. If you want a clean execution (just the filters you added), do not forget to runresetFilters()
method before this one.- Parameters:
controllerClass
- class of controllerfilter
- instance of a filter to add
-
addFilter
Adds a global filter for the duration of the current spec. If you want a clean execution (just the filters you added), do not forget to runresetFilters()
method before this one.- Parameters:
filter
- instance of a filter to add
-