// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java
// public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path";


import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import dagger.ObjectGraph;
import org.testng.annotations.Test;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import static com.leacox.dagger.servlet.ManagedServletPipeline.REQUEST_DISPATCHER_REQUEST;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
                    protected void service(HttpServletRequest servletRequest,
                                           HttpServletResponse httpServletResponse) throws ServletException, IOException {

                        final String path = servletRequest.getPathInfo();

                        if (null == expectedPathInfo) {
                            assertNull(path, String.format("expected [%s] but was [%s]", expectedPathInfo, path));
                        } else {
                            assertEquals(path, expectedPathInfo,
                                    String.format("expected [%s] but was [%s]", expectedPathInfo, path));
                        }

                        //assert memoizer
                        //noinspection StringEquality
                        assertSame(servletRequest.getPathInfo(), path, "memo field did not work");

                        run[0] = true;
                    }
                });

        expect(request.getRequestURI())
                .andReturn(requestUri);

        expect(request.getServletPath())
                .andReturn(servletPath)
                .anyTimes();

        expect(request.getContextPath())
                .andReturn(contextPath);

// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ManagedServletPipeline.java
// public static final String REQUEST_DISPATCHER_REQUEST = "javax.servlet.forward.servlet_path";


// Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletDefinitionPathsTest.java
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import dagger.ObjectGraph;
import org.testng.annotations.Test;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import static com.leacox.dagger.servlet.ManagedServletPipeline.REQUEST_DISPATCHER_REQUEST;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;

                    protected void service(HttpServletRequest servletRequest,
                                           HttpServletResponse httpServletResponse) throws ServletException, IOException {

                        final String path = servletRequest.getPathInfo();

                        if (null == expectedPathInfo) {
                            assertNull(path, String.format("expected [%s] but was [%s]", expectedPathInfo, path));
                        } else {
                            assertEquals(path, expectedPathInfo,
                                    String.format("expected [%s] but was [%s]", expectedPathInfo, path));
                        }

                        //assert memoizer
                        //noinspection StringEquality
                        assertSame(servletRequest.getPathInfo(), path, "memo field did not work");

                        run[0] = true;
                    }
                });

        expect(request.getRequestURI())
                .andReturn(requestUri);

        expect(request.getServletPath())
                .andReturn(servletPath)
                .anyTimes();

        expect(request.getContextPath())
                .andReturn(contextPath);

        expect(request.getAttribute(REQUEST_DISPATCHER_REQUEST)).andReturn(null);