package gov.va.med.edp.web.controller;

import junit.framework.TestCase;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.web.context.support.StaticWebApplicationContext;
import org.springframework.web.servlet.support.WebContentGenerator;

/**
 * TODO: document AbstractControllerTest
 */
public abstract class AbstractControllerTest extends TestCase {

    protected MockHttpSession session = new MockHttpSession();
    protected MockHttpServletRequest request = new MockHttpServletRequest();
    protected MockHttpServletResponse response = new MockHttpServletResponse();
    protected StaticWebApplicationContext webAppContext;

    protected void setUp() throws Exception {
        request.setSession(session);
        request.setMethod(WebContentGenerator.METHOD_GET);

        webAppContext = new StaticWebApplicationContext();
        webAppContext.setServletContext(session.getServletContext());
    }
}
