Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Best practice for separating frontend and backend logic in wicket for testing?

$
0
0
There are some pages in my project which needs to interact with the
backend. I have to load the data I would like to display or I have to
persist form data. This works as I expect it and Wicket does here a
great job.

But how can I test this? For example I would like to test if page
DisplayDataPage redirects to an error page if a pageparameter is missing
or the data specified by a pageparameter does not exist.

My DisplayDataPage accesses the BackendService by a getBackend() method.

To test my page I don't want to setup the whole infrastructur. Normally
I would mock this method and return a mock instance of BackendService.
But with WicketTest I have to use classes or to provide a IPageProvider
implementation.

So, what is the best practice for a clean and testable separation of
frontend and backend logic in Wicket?

Bye,

Oliver

M +49 178 7903538
E oliver.fischer [ at ] profitbricks.com
W http://www.profitbricks.com
J oliver.fischer [ at ] profitbricks.com

Viewing all articles
Browse latest Browse all 5648

Trending Articles