Class IntegrationSpec

All Implemented Interfaces:
JSpecSupport
Direct Known Subclasses:
AppIntegrationSpec, DBIntegrationSpec

public class IntegrationSpec extends RequestSpecHelper
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
  • Constructor Details

    • IntegrationSpec

      public IntegrationSpec()
  • Method Details

    • resetFilters

      protected void resetFilters()
      Clears all filters from context even if they are defined in the AppControllerConfig class. This method allows to run integration specs cleanly, with filters specifically set by addFilter(Class, HttpSupportFilter) method.
    • controller

      protected RequestBuilder controller(String controllerName)
    • setTemplateLocation

      protected void setTemplateLocation(String templateLocation)
      Overrides:
      setTemplateLocation in class SpecHelper
      Parameters:
      templateLocation - this is a relative location starting from the module root, intended for testing.
    • addFilter

      protected void addFilter(Class<? extends AppController> controllerClass, HttpSupportFilter filter)
      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 run resetFilters() method before this one.
      Parameters:
      controllerClass - class of controller
      filter - instance of a filter to add
    • addFilter

      protected void addFilter(HttpSupportFilter filter)
      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 run resetFilters() method before this one.
      Parameters:
      filter - instance of a filter to add