How can I run a test in deployment mode with WicketTester?

65 Views Asked by At

I want to run my tests in WicketTester in deployment mode? Is it possible to do that? I tried searching the web, but WicketTester is not really well documented.

1

There are 1 best solutions below

0
a.ha On

Yes, it is possible. If you call the WicketTester constructor you can pass a parameter of type WebApplication. The WebApplication object defines if your application is running in development or deployment mode. If your using a DummyWebApplication and always want to run your tests in deployment mode just override getConfigurationType()like shown below:

WicketTester.DummyWebApplication application = new WicketTester.DummyWebApplication() {
        @Override
        public String getConfigurationType() {
            return Application.DEPLOYMENT;
        }
};
WicketTester wicketTester = new WicketTester(application);

There are multiple other ways, like defining it in your web.xml of your application used for tests or set the system wide property wicket.configuration. Also check WebApplication.getConfigurationType() on Github