Unit Testing

compared with
Current by Marcus Kraßmann
on Oct 01, 2012 01:16.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (7)

View Page History
h3. MockRoundtrips are compatible with Spring !

Now that you wan't to use MockRoundtrip with your spring/stripes application, you've got a nice exception :
{code:title=Exception with Spring}
15:01:19,277 WARN DefaultExceptionHandler:90
{code:title=Unhandled exception message}
WARN net.sourceforge.stripes.exception.DefaultExceptionHandler - Unhandled exception caught by the Stripes default exception handler.
net.sourceforge.stripes.exception.StripesRuntimeException: Submission of a wizard form in Stripes absolutely requires that the hidden field Stripes writes containing the names of the fields present on the form is present and encrypted (as Stripes write it). This is necessary to prevent a user from spoofing the system and getting around any security/data checks.
net.sourceforge.stripes.exception.StripesRuntimeException: Submission of a wizard form in Stripes absolutely
requires that the hidden field Stripes writes containing the names of the fields present on the form is present
and encrypted (as Stripes write it). This is necessary to prevent a user from spoofing the system and getting
around any security/data checks.
{code}


{code:title=Error in Wizard action test log}
ERROR net.sourceforge.stripes.controller.StripesFilter - net.sourceforge.stripes.exception.StripesRuntimeException:
net.sourceforge.stripes.exception.StripesRuntimeException: Something is trying to access the current Stripes configuration but the current request was never routed through the StripesFilter! As a result the appropriate Configuration object cannot be located. Please take a look at the exact URL in your browser's address bar and ensure that any requests to that URL will be filtered through the StripesFilter according to the filter mappings in your web.xml.
Something is trying to access the current Stripes configuration but the current request was never routed through
the StripesFilter! As a result the appropriate Configuration object cannot be located. Please take a look at the
exact URL in your browser's address bar and ensure that any requests to that URL will be filtered through the
StripesFilter according to the filter mappings in your web.xml.
{code}

public void cleanUp() {
// destroy Stripes filter for every test method
context.getFilters().get(0).destroy(); ctx.getFilters().get(0).destroy(); // assume you have only one (first and single) filter in config
}
{code}