/**
 * Licensed to the Austrian Association for Software Tool Integration (AASTI)
 * under one or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information regarding copyright
 * ownership. The AASTI licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openengsb.ui.admin;

import org.apache.wicket.util.tester.WicketTester;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.MethodRule;
import org.openengsb.core.test.rules.DedicatedThread;
import org.ops4j.pax.wicket.test.spring.PaxWicketSpringBeanComponentInjector;

public abstract class AbstractLoginTest extends AbstractUITest {

    @Rule
    public MethodRule dedicatedThread = new DedicatedThread();

    @Before
    public void setupLogin() throws Exception {
        mockAuthentication();
        tester = new WicketTester();
        tester.getApplication().addComponentInstantiationListener(
            new PaxWicketSpringBeanComponentInjector(tester.getApplication(), context));
    }
}

@@ -856,16 +856,310 @@
 admin;%0A%0A
+import org.apache.wicket.Page;%0Aimport org.apache.wicket.Request;%0Aimport org.apache.wicket.Response;%0Aimport org.apache.wicket.Session;%0Aimport org.apache.wicket.protocol.http.HttpSessionStore;%0Aimport org.apache.wicket.protocol.http.WebApplication;%0Aimport org.apache.wicket.session.ISessionStore;%0A
 import o
@@ -1201,16 +1201,16 @@
 Tester;%0A
-
 import o
@@ -1338,16 +1338,59 @@
 Thread;%0A
+import org.openengsb.ui.admin.index.Index;%0A
 import o
@@ -1686,24 +1686,24 @@
 tication();%0A
-
         test
@@ -1724,16 +1724,487 @@
 tTester(
+new WebApplication() %7B%0A            @Override%0A            public Class%3C? extends Page%3E getHomePage() %7B%0A                return Index.class;%0A            %7D%0A%0A            @Override%0A            public Session newSession(Request request, Response response) %7B%0A                return new AdminWebSession(request);%0A            %7D%0A%0A            @Override%0A            protected ISessionStore newSessionStore() %7B%0A                return new HttpSessionStore(this);%0A            %7D%0A        %7D
 );%0A     

Fix additional UI unit tests