integration tests for SLING-7508
diff --git a/src/main/java/org/apache/sling/models/it/models/RequestSelfModel.java b/src/main/java/org/apache/sling/models/it/models/RequestSelfModel.java
new file mode 100644
index 0000000..e905cd1
--- /dev/null
+++ b/src/main/java/org/apache/sling/models/it/models/RequestSelfModel.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.apache.sling.models.it.models;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+
+public interface RequestSelfModel {
+
+    SlingHttpServletRequest getRequest();
+}
diff --git a/src/main/java/org/apache/sling/models/it/models/RequestSelfModelImpl.java b/src/main/java/org/apache/sling/models/it/models/RequestSelfModelImpl.java
new file mode 100644
index 0000000..f8ccb2d
--- /dev/null
+++ b/src/main/java/org/apache/sling/models/it/models/RequestSelfModelImpl.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.apache.sling.models.it.models;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.models.annotations.Model;
+import org.apache.sling.models.annotations.injectorspecific.Self;
+
+@Model(adaptables = SlingHttpServletRequest.class, adapters = RequestSelfModel.class)
+public class RequestSelfModelImpl implements RequestSelfModel {
+
+    @Self
+    private SlingHttpServletRequest request;
+
+    public SlingHttpServletRequest getRequest() {
+        return request;
+    }
+}
diff --git a/src/main/java/org/apache/sling/models/it/servlets/PathBoundServlet.java b/src/main/java/org/apache/sling/models/it/servlets/PathBoundServlet.java
new file mode 100644
index 0000000..170d7f3
--- /dev/null
+++ b/src/main/java/org/apache/sling/models/it/servlets/PathBoundServlet.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.apache.sling.models.it.servlets;
+
+import org.apache.felix.scr.annotations.sling.SlingServlet;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
+import org.apache.sling.models.it.models.RequestSelfModel;
+
+import javax.servlet.ServletException;
+import java.io.IOException;
+
+@SlingServlet(paths = "/apps/rtpickerrequest")
+public class PathBoundServlet extends SlingSafeMethodsServlet {
+
+    @Override
+    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException {
+        RequestSelfModel model = request.adaptTo(RequestSelfModel.class);
+        response.setStatus(200);
+    }
+}
diff --git a/src/test/java/org/apache/sling/models/testing/PathBoundServletIT.java b/src/test/java/org/apache/sling/models/testing/PathBoundServletIT.java
new file mode 100644
index 0000000..1c9d452
--- /dev/null
+++ b/src/test/java/org/apache/sling/models/testing/PathBoundServletIT.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.apache.sling.models.testing;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.engine.SlingRequestProcessor;
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.apache.sling.models.testing.helper.FakeRequest;
+import org.apache.sling.models.testing.helper.FakeResponse;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class PathBoundServletIT {
+
+    @Rule
+    public final TeleporterRule teleporter = TeleporterRule.forClass(getClass(), "SM_Teleporter");
+
+    private ResourceResolverFactory rrFactory;
+    private SlingRequestProcessor slingRequestProcessor;
+
+    @Before
+    public void setup() {
+        rrFactory = teleporter.getService(ResourceResolverFactory.class);
+        slingRequestProcessor = teleporter.getService(SlingRequestProcessor.class);
+    }
+
+    @Test
+    public void testDoubledServlets() throws Exception {
+        ResourceResolver resolver = null;
+        try {
+            resolver = rrFactory.getAdministrativeResourceResolver(null);
+            FakeResponse response = new FakeResponse();
+            slingRequestProcessor.processRequest(new FakeRequest("/apps/rtpickerrequest"), response, resolver);
+
+            Assert.assertEquals(200, response.getStatus());
+        } finally {
+            if (resolver != null && resolver.isLive()) {
+                resolver.close();
+            }
+        }
+    }
+}
diff --git a/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java b/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java
index e73cb6a..5221f31 100644
--- a/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java
+++ b/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java
@@ -40,6 +40,8 @@
 import org.apache.sling.junit.rules.TeleporterRule;
 import org.apache.sling.models.factory.MissingExporterException;
 import org.apache.sling.models.factory.ModelFactory;
+import org.apache.sling.models.testing.helper.FakeRequest;
+import org.apache.sling.models.testing.helper.FakeResponse;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Rule;
diff --git a/src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java b/src/test/java/org/apache/sling/models/testing/helper/FakeRequest.java
similarity index 97%
rename from src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java
rename to src/test/java/org/apache/sling/models/testing/helper/FakeRequest.java
index 4b90c59..935f706 100644
--- a/src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java
+++ b/src/test/java/org/apache/sling/models/testing/helper/FakeRequest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.models.testing.exporter;
+package org.apache.sling.models.testing.helper;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletInputStream;
@@ -31,7 +31,7 @@
 import java.util.Locale;
 import java.util.Map;
 
-class FakeRequest implements HttpServletRequest {
+public class FakeRequest implements HttpServletRequest {
 
     private final String path;
 
@@ -39,7 +39,7 @@
 
     private final Map<String, Object> attributes = new HashMap<String, Object>();
 
-    FakeRequest(String path) {
+    public FakeRequest(String path) {
         this.path = path;
         this.requestUrl = new StringBuffer("http://notarealhost").append(path);
     }
diff --git a/src/test/java/org/apache/sling/models/testing/exporter/FakeResponse.java b/src/test/java/org/apache/sling/models/testing/helper/FakeResponse.java
similarity index 93%
rename from src/test/java/org/apache/sling/models/testing/exporter/FakeResponse.java
rename to src/test/java/org/apache/sling/models/testing/helper/FakeResponse.java
index 883d380..7cf757a 100644
--- a/src/test/java/org/apache/sling/models/testing/exporter/FakeResponse.java
+++ b/src/test/java/org/apache/sling/models/testing/helper/FakeResponse.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.models.testing.exporter;
+package org.apache.sling.models.testing.helper;
 
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.Cookie;
@@ -24,11 +24,12 @@
 import java.io.StringWriter;
 import java.util.Locale;
 
-class FakeResponse implements HttpServletResponse {
+public class FakeResponse implements HttpServletResponse {
 
     private StringWriter stringWriter = new StringWriter();
     private String contentType = null;
     private String characterEncoding = null;
+    private int status = -1;
 
     @Override
     public void addCookie(Cookie cookie) {
@@ -106,12 +107,12 @@
 
     @Override
     public void setStatus(int sc) {
-
+        this.status = sc;
     }
 
     @Override
     public void setStatus(int sc, String sm) {
-
+        setStatus(sc);
     }
 
     @Override
@@ -192,4 +193,8 @@
     public StringWriter getStringWriter() {
         return stringWriter;
     }
+
+    public int getStatus() {
+        return status;
+    }
 }