@@ -0,0 +1,1972 @@
+package org.pac4j.core.http.adapter;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.pac4j.core.context.HttpConstants;%0Aimport org.pac4j.core.context.JEEContext;%0Aimport org.pac4j.core.exception.TechnicalException;%0Aimport org.pac4j.core.exception.http.FoundAction;%0Aimport org.pac4j.core.exception.http.OkAction;%0Aimport org.pac4j.core.exception.http.StatusAction;%0Aimport org.pac4j.core.util.TestsConstants;%0A%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0A%0Aimport static org.mockito.Mockito.*;%0A%0A/**%0A * Tests the %7B@link JEEHttpActionAdapter%7D.%0A *%0A * @author Jerome LELEU%0A * @since 4.0.0%0A */%0Apublic final class JEEHttpActionAdapterTest implements TestsConstants %7B%0A%0A    private HttpServletResponse response;%0A%0A    private JEEContext context;%0A%0A    private PrintWriter writer;%0A%0A    @Before%0A    public void setUp() throws IOException %7B%0A        response = mock(HttpServletResponse.class);%0A        writer = mock(PrintWriter.class);%0A        when(response.getWriter()).thenReturn(writer);%0A        context = mock(JEEContext.class);%0A        when(context.getNativeResponse()).thenReturn(response);%0A    %7D%0A%0A    @Test(expected = TechnicalException.class)%0A    public void testNullAction() %7B%0A        JEEHttpActionAdapter.INSTANCE.adapt(null, context);%0A    %7D%0A%0A    @Test%0A    public void testActionWithLocation() %7B%0A        JEEHttpActionAdapter.INSTANCE.adapt(new FoundAction(PAC4J_URL), context);%0A        verify(response).setStatus(302);%0A        verify(context).setResponseHeader(HttpConstants.LOCATION_HEADER, PAC4J_URL);%0A    %7D%0A%0A    @Test%0A    public void testError500() throws IOException %7B%0A        JEEHttpActionAdapter.INSTANCE.adapt(new StatusAction(500), context);%0A        verify(response).sendError(500);%0A    %7D%0A%0A    @Test%0A    public void testActionWithContent() %7B%0A        JEEHttpActionAdapter.INSTANCE.adapt(new OkAction(VALUE), context);%0A        verify(response).setStatus(200);%0A        verify(writer).write(VALUE);%0A    %7D%0A%7D%0A

add JEEHttpActionAdapterTest