public abstract class AppIntegrationSpec extends IntegrationSpec
DBConnectionFilter
is used in the application, it is bypassed.
Instead, the DB connection to a test DB is made from a super class. A connection is opened to
a test DB, transaction is started before each test. After each test, a connection is closed and a transaction
is rolled back.SpecHelper.ModuleBuilder
Constructor and Description |
---|
AppIntegrationSpec() |
Modifier and Type | Method and Description |
---|---|
void |
afterAppIntegrationSpec() |
void |
beforeAppIntegrationSpec() |
protected RequestBuilder |
controller(String controllerPath)
Takes controller path.
|
AppContext |
getContext()
Returns instance of
AppContext |
protected void |
suppressDb()
Call this method from a constructor of your spec in cases you do not need DB connections.
|
addFilter, setTemplateLocation
assigns, atStart00, bytesContent, contentType, cookie, cookieValue, count, getCookies, header, layout, redirected, redirectValue, responseContent, statusCode, template, text, val, val, valBoolean, valDouble, valFloat, valInteger, valLong, vals, valString
afterEnd, atStart, createInjector, flash, flash, flashExists, registerTag, session, session, session, sessionBoolean, sessionDouble, sessionFloat, sessionHas, sessionInteger, sessionLong, sessionObject, sessionString, setInjector
public void beforeAppIntegrationSpec() throws javax.servlet.ServletException
javax.servlet.ServletException
public void afterAppIntegrationSpec()
public AppContext getContext()
AppContext
AppContext
protected RequestBuilder controller(String controllerPath)
/admin/permissions
where "admin" is a sub-package of controller
and "permissions" is a name of controller. Such path implies a name of a controller class:
app.controllers.admin.PermissionsController
.
Controller path always starts with a slash: "/".controller
in class IntegrationSpec
controllerPath
- protected void suppressDb()
Copyright © 2016. All rights reserved.