You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2020/10/12 09:46:39 UTC

[sling-org-apache-sling-graphql-core] branch master updated: SLING-9813 - remove scripted SlingDataFetcher support

This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-graphql-core.git


The following commit(s) were added to refs/heads/master by this push:
     new d22fb27  SLING-9813 - remove scripted SlingDataFetcher support
d22fb27 is described below

commit d22fb2739251aab01f5be7dbbec21f4b2a066d6a
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Oct 12 11:46:07 2020 +0200

    SLING-9813 - remove scripted SlingDataFetcher support
---
 README.md                                          |  25 -----
 .../core/engine/ScriptedDataFetcherProvider.java   |  56 -----------
 .../core/engine/SlingDataFetcherSelector.java      |   9 +-
 .../core/engine/DefaultQueryExecutorTest.java      |   9 --
 .../graphql/core/engine/ResourceQueryTestBase.java |   1 -
 .../engine/ScriptedDataFetcherProviderTest.java    | 105 ---------------------
 .../core/engine/SlingDataFetcherSelectorTest.java  |   6 --
 .../sling/graphql/core/it/GraphQLServletIT.java    |  10 --
 .../sling/graphql/core/it/ServerSideQueryIT.java   |  16 +---
 .../core/schema/SchemaDescriptionsTest.java        |   2 -
 .../graphql/fetchers/scripted/example/fetcher.js   |  28 ------
 .../apps/graphql/test/one/GQLschema.jsp            |   2 +-
 .../initial-content/apps/graphql/test/one/json.gql |   2 +-
 .../apps/graphql/test/one/scripted.GQLschema.jsp   |  41 --------
 .../apps/graphql/test/one/scripted.json.gql        |  29 ------
 .../apps/graphql/test/two/scripted.GQLschema.jsp   |  40 --------
 src/test/resources/test-schema.txt                 |   2 -
 17 files changed, 6 insertions(+), 377 deletions(-)

diff --git a/README.md b/README.md
index ef2f229..b6159b6 100644
--- a/README.md
+++ b/README.md
@@ -105,31 +105,6 @@ which hava Java package names that start with `org.apache.sling`.
 The `<options>` and `<source>` arguments of the directive can be used by the
 `SlingDataFetcher` services to influence their behavior.
 
-### Scripted SlingDataFetchers
-
-Besides Java, `SlingDataFetcher` scripts can be written in any scripting language that supported by the Sling instance's configuration.
-
-Here's an example from the test code. The schema contains the following statement:
-
-    scriptedFetcher (testing : String) : Test @fetcher(name:"scripted/example")
-
-And here's the data fetcher code:
-
-```javascript
-var result = { 
-    boolValue: true,
-    resourcePath: "From the test script: " + resource.path,
-    testingArgument: environment.getArgument("testing"),
-    anotherValue: 450 + 1
-};
-
-result;
-```
-    
-The data fetcher provider then looks for a script that handles the `graphql/fetchers/scripted/example` resource type with a `fetcher`script name. `graphql/fetchers`is a prefix (hardcoded for now) and `scripted/example` comes from the above schema's `@fetcher` directive.
-
-In that test, the `/graphql/fetchers/scripted/example/fetcher.js` shown above resolves with those requirements, it is executed to retrieve the requested data. That execution happens with a context consisting of the current `SlingDataFetcherEnvironment` under the `environment` key, and the current Sling Resource under the `resource` key, both used in this test script.
-
 ## Caching: Persisted queries API
 
 No matter how you decide to create your Sling GraphQL endpoints, you have the option to allow GraphQL clients to use persisted queries.
diff --git a/src/main/java/org/apache/sling/graphql/core/engine/ScriptedDataFetcherProvider.java b/src/main/java/org/apache/sling/graphql/core/engine/ScriptedDataFetcherProvider.java
deleted file mode 100644
index 2cf294f..0000000
--- a/src/main/java/org/apache/sling/graphql/core/engine/ScriptedDataFetcherProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-
-/*
- * 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.graphql.core.engine;
-
-import javax.servlet.Servlet;
-
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.resource.SyntheticResource;
-import org.apache.sling.api.scripting.SlingScript;
-import org.apache.sling.api.servlets.ServletResolver;
-import org.apache.sling.graphql.api.SlingDataFetcher;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-/**
- * Resolves a SlingDataFetcher name to a SlingScript if available.
- */
-@Component(service = ScriptedDataFetcherProvider.class)
-public class ScriptedDataFetcherProvider {
-    public static final String SCRIPT_NAME = "fetcher";
-    public static final String FAKE_RESOURCE_TYPE_PREFIX = "graphql/fetchers/";
-
-    @Reference
-    private ServletResolver servletResolver;
-
-    @Nullable
-    SlingDataFetcher<Object> getDataFetcher(@NotNull String name) {
-        final Resource r = new SyntheticResource(null,
-                "FAKE_RESOURCE_PATH", FAKE_RESOURCE_TYPE_PREFIX + name);
-        final Servlet s = servletResolver.resolveServlet(r, SCRIPT_NAME);
-        if(s instanceof SlingScript) {
-            return new SlingScriptWrapper((SlingScript)s);
-        }
-        return null;
-    }
-}
diff --git a/src/main/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelector.java b/src/main/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelector.java
index def4e91..1d913d5 100644
--- a/src/main/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelector.java
+++ b/src/main/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelector.java
@@ -62,18 +62,11 @@ public class SlingDataFetcherSelector {
      */
     public static final String RESERVED_PACKAGE_PREFIX = "org.apache.sling.";
 
-    @Reference
-    private ScriptedDataFetcherProvider scriptedDataFetcherProvider;
-
-    /** @return a SlingDataFetcher, or null if none available. First tries to get an
-     *  OSGi SlingDataFetcher service, and if not found tries to find a scripted SlingDataFetcher.
+    /** @return a SlingDataFetcher, or null if none available.
      */
     @Nullable
     public SlingDataFetcher<Object> getSlingFetcher(@NotNull String name) {
         SlingDataFetcher<Object> result = getOsgiServiceFetcher(name);
-        if(result == null) {
-            result = scriptedDataFetcherProvider.getDataFetcher(name);
-        }
         return result;
     }
 
diff --git a/src/test/java/org/apache/sling/graphql/core/engine/DefaultQueryExecutorTest.java b/src/test/java/org/apache/sling/graphql/core/engine/DefaultQueryExecutorTest.java
index 41a0e4b..d137cc6 100644
--- a/src/test/java/org/apache/sling/graphql/core/engine/DefaultQueryExecutorTest.java
+++ b/src/test/java/org/apache/sling/graphql/core/engine/DefaultQueryExecutorTest.java
@@ -129,13 +129,4 @@ public class DefaultQueryExecutorTest extends ResourceQueryTestBase {
         }
     }
 
-    @Test
-    public void scriptedFetcherProviderTest() throws Exception {
-        final String json = queryJSON("{ currentResource { path } scriptedFetcher (testing: \"1, 2, 3\") { boolValue resourcePath " +
-                "testingArgument } }", new String[] {});
-        assertThat(json, hasJsonPath("$.data.currentResource.path", equalTo(resource.getPath())));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.boolValue", equalTo(true)));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.resourcePath", equalTo(resource.getPath())));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.testingArgument", equalTo("1, 2, 3")));
-    }
 }
diff --git a/src/test/java/org/apache/sling/graphql/core/engine/ResourceQueryTestBase.java b/src/test/java/org/apache/sling/graphql/core/engine/ResourceQueryTestBase.java
index c5b3095..790c14b 100644
--- a/src/test/java/org/apache/sling/graphql/core/engine/ResourceQueryTestBase.java
+++ b/src/test/java/org/apache/sling/graphql/core/engine/ResourceQueryTestBase.java
@@ -64,7 +64,6 @@ public abstract class ResourceQueryTestBase {
         Mockito.when(servletResolver.resolveServlet(Mockito.any(Resource.class), Mockito.any(String.class))).thenReturn(mss);
         context.bundleContext().registerService(ServletResolver.class, servletResolver, null);
 
-        context.registerInjectActivateService(new ScriptedDataFetcherProvider());
         context.registerInjectActivateService(new SlingDataFetcherSelector());
         context.registerInjectActivateService(new SlingScalarsProvider());
         context.registerInjectActivateService(new RankedSchemaProviders());
diff --git a/src/test/java/org/apache/sling/graphql/core/engine/ScriptedDataFetcherProviderTest.java b/src/test/java/org/apache/sling/graphql/core/engine/ScriptedDataFetcherProviderTest.java
deleted file mode 100644
index b41bdb0..0000000
--- a/src/test/java/org/apache/sling/graphql/core/engine/ScriptedDataFetcherProviderTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.graphql.core.engine;
-
-import static org.junit.Assert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.nullValue;
-
-import java.util.Map;
-import java.util.UUID;
-
-import javax.servlet.Servlet;
-
-import org.apache.sling.api.resource.Resource;
-import org.apache.sling.api.servlets.ServletResolver;
-import org.apache.sling.graphql.api.SlingDataFetcher;
-import org.apache.sling.graphql.api.SlingDataFetcherEnvironment;
-import org.apache.sling.graphql.core.mocks.MockScriptServlet;
-import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mockito;
-
-public class ScriptedDataFetcherProviderTest {
-
-    private ScriptedDataFetcherProvider provider;
-    private static final String FETCHER_NAME = "this/fetcher";
-
-    private ServletResolver servletResolver;
-    private Servlet servletOnly;
-    private Servlet servletAndScript;
-
-    @Rule
-    public final OsgiContext context = new OsgiContext();
-
-    @Before
-    public void setup() {
-        servletOnly = Mockito.mock(Servlet.class);
-        servletAndScript = new MockScriptServlet();
-        servletResolver = Mockito.mock(ServletResolver.class);
-
-        context.bundleContext().registerService(ServletResolver.class, servletResolver, null);
-        context.registerInjectActivateService(new ScriptedDataFetcherProvider());
-        provider = context.getService(ScriptedDataFetcherProvider.class);
-    }
-
-    private void setReturnedServlet(Servlet s) {
-        Mockito.when(servletResolver.resolveServlet(Mockito.any(Resource.class), Mockito.any(String.class))).thenReturn(s);
-    }
-
-    private void assertServletResolverCall() {
-        ArgumentCaptor<Resource> resourceArgument = ArgumentCaptor.forClass(Resource.class);
-        ArgumentCaptor<String> scriptNameArgument = ArgumentCaptor.forClass(String.class);
-        Mockito.verify(servletResolver).resolveServlet(resourceArgument.capture(), scriptNameArgument.capture());
-        assertThat(resourceArgument.getValue().getResourceType(), equalTo("graphql/fetchers/" + FETCHER_NAME));
-        assertThat(scriptNameArgument.getValue(), equalTo("fetcher"));
-    }
-
-    @Test
-    @SuppressWarnings("unchecked")
-    public void testFetcherProviderFound() throws Exception {
-        setReturnedServlet(servletAndScript);
-        final SlingDataFetcher<Object> f = provider.getDataFetcher(FETCHER_NAME);
-        assertServletResolverCall();
-        assertThat("Expecting a SlingDataFetcher", f, not(nullValue()));
-        final SlingDataFetcherEnvironment env = Mockito.mock(SlingDataFetcherEnvironment.class);
-        final Map<String, Object> result = (Map<String, Object>)f.get(env);
-        assertThat(result.get("resourcePath"), nullValue());
-    }
-
-    @Test
-    public void testServletNotFound() throws Exception {
-        setReturnedServlet(null);
-        final SlingDataFetcher<Object> f = provider.getDataFetcher(FETCHER_NAME);
-        assertServletResolverCall();
-        assertThat(f, nullValue());
-    }
-
-    @Test
-    public void testServletFoundButNotAScript() throws Exception {
-        setReturnedServlet(servletOnly);
-        final SlingDataFetcher<Object> f = provider.getDataFetcher(FETCHER_NAME);
-        assertServletResolverCall();
-        assertThat(f, nullValue());
-    }
-}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelectorTest.java b/src/test/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelectorTest.java
index bc81723..224b63c 100644
--- a/src/test/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelectorTest.java
+++ b/src/test/java/org/apache/sling/graphql/core/engine/SlingDataFetcherSelectorTest.java
@@ -24,11 +24,8 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
 
-import java.io.IOException;
-
 import com.example.fetchers.DoNothingFetcher;
 
 import org.apache.sling.graphql.api.SlingDataFetcher;
@@ -40,7 +37,6 @@ import org.apache.sling.testing.mock.osgi.junit.OsgiContext;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
-import org.mockito.Mockito;
 
 public class SlingDataFetcherSelectorTest {
 
@@ -51,8 +47,6 @@ public class SlingDataFetcherSelectorTest {
 
     @Before
     public void setup() {
-        final ScriptedDataFetcherProvider sdfp = mock(ScriptedDataFetcherProvider.class);
-        context.bundleContext().registerService(ScriptedDataFetcherProvider.class, sdfp, null);
         context.registerInjectActivateService(new SlingDataFetcherSelector());
         selector = context.getService(SlingDataFetcherSelector.class);
 
diff --git a/src/test/java/org/apache/sling/graphql/core/it/GraphQLServletIT.java b/src/test/java/org/apache/sling/graphql/core/it/GraphQLServletIT.java
index a185058..9e78a1e 100644
--- a/src/test/java/org/apache/sling/graphql/core/it/GraphQLServletIT.java
+++ b/src/test/java/org/apache/sling/graphql/core/it/GraphQLServletIT.java
@@ -226,16 +226,6 @@ public class GraphQLServletIT extends GraphQLCoreTestSupport {
     }
 
     @Test
-    public void testScriptedDataFetcher() throws Exception {
-        final String query = "{ currentResource { path } scriptedFetcher (testing: \"1,2,3\") { boolValue resourcePath testingArgument } }";
-        final String json = getContent("/content/graphql/two.scripted.gql", "query", query);
-        assertThat(json, hasJsonPath("$.data.currentResource.path", equalTo("/content/graphql/two")));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.boolValue", equalTo(true)));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.resourcePath", equalTo("From the test script: /content/graphql/two")));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.testingArgument", equalTo("1,2,3")));
-    }
-
-    @Test
     public void testMissingQuery() throws Exception {
         MockSlingHttpServletResponse response = executeRequest("GET", "/graphql/two.gql", null, null, null, -1);
         assertEquals(400, response.getStatus());
diff --git a/src/test/java/org/apache/sling/graphql/core/it/ServerSideQueryIT.java b/src/test/java/org/apache/sling/graphql/core/it/ServerSideQueryIT.java
index e8965dd..7825b94 100644
--- a/src/test/java/org/apache/sling/graphql/core/it/ServerSideQueryIT.java
+++ b/src/test/java/org/apache/sling/graphql/core/it/ServerSideQueryIT.java
@@ -79,23 +79,13 @@ public class ServerSideQueryIT extends GraphQLCoreTestSupport {
 
     @Test
     public void testJsonContent() throws Exception {
-        assertDefaultContent("", "scriptedSchemaResource");
+        assertDefaultContent("", "oneSchemaResource");
     }
 
     @Test
     public void testMultipleSchemaProviders() throws Exception {
-        new ReplacingSchemaProvider("scriptedSchemaResource", "REPLACED").register(bundleContext, defaultSchemaProvider, Integer.MAX_VALUE);
-        new ReplacingSchemaProvider("scriptedSchemaResource", "NOT_THIS_ONE").register(bundleContext, defaultSchemaProvider, 1);
+        new ReplacingSchemaProvider("oneSchemaResource", "REPLACED").register(bundleContext, defaultSchemaProvider, Integer.MAX_VALUE);
+        new ReplacingSchemaProvider("oneSchemaResource", "NOT_THIS_ONE").register(bundleContext, defaultSchemaProvider, 1);
         assertDefaultContent(".REPLACED", "REPLACED");
     }
-
-    @Test
-    public void testScriptedDataFetcher() throws Exception {
-        final String json = getContent("/graphql/one.scripted.json");
-        assertThat(json, hasJsonPath("$.data.currentResource.resourceType", equalTo("graphql/test/one")));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.boolValue", equalTo(true)));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.resourcePath", equalTo("From the test script: /content/graphql/one")));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.testingArgument", equalTo("1,2,42")));
-        assertThat(json, hasJsonPath("$.data.scriptedFetcher.anotherValue", equalTo(451)));
-    }
 }
diff --git a/src/test/java/org/apache/sling/graphql/core/schema/SchemaDescriptionsTest.java b/src/test/java/org/apache/sling/graphql/core/schema/SchemaDescriptionsTest.java
index 0b247a2..6b53117 100644
--- a/src/test/java/org/apache/sling/graphql/core/schema/SchemaDescriptionsTest.java
+++ b/src/test/java/org/apache/sling/graphql/core/schema/SchemaDescriptionsTest.java
@@ -28,7 +28,6 @@ import org.apache.sling.api.servlets.ServletResolver;
 import org.apache.sling.graphql.api.SchemaProvider;
 import org.apache.sling.graphql.api.engine.QueryExecutor;
 import org.apache.sling.graphql.core.engine.DefaultQueryExecutor;
-import org.apache.sling.graphql.core.engine.ScriptedDataFetcherProvider;
 import org.apache.sling.graphql.core.engine.SlingDataFetcherSelector;
 import org.apache.sling.graphql.core.mocks.MockSchemaProvider;
 import org.apache.sling.graphql.core.scalars.SlingScalarsProvider;
@@ -102,7 +101,6 @@ public class SchemaDescriptionsTest {
         Mockito.when(resource.getResourceType()).thenReturn(resourceType);
         final ServletResolver servletResolver = Mockito.mock(ServletResolver.class);
         context.bundleContext().registerService(ServletResolver.class, servletResolver, null);
-        context.registerInjectActivateService(new ScriptedDataFetcherProvider());
         context.registerInjectActivateService(new SlingDataFetcherSelector());
         context.registerInjectActivateService(new SlingScalarsProvider());
         context.registerService(SchemaProvider.class, new MockSchemaProvider("test-schema"));
diff --git a/src/test/resources/initial-content/apps/graphql/fetchers/scripted/example/fetcher.js b/src/test/resources/initial-content/apps/graphql/fetchers/scripted/example/fetcher.js
deleted file mode 100644
index 0e7a67d..0000000
--- a/src/test/resources/initial-content/apps/graphql/fetchers/scripted/example/fetcher.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.
- */
-
-// Scripted SlingDataFetcher used in integration tests
-var result = { 
-    boolValue: true,
-    resourcePath: "From the test script: " + resource.path,
-    testingArgument: environment.getArgument("testing"),
-    anotherValue: 450 + 1
-};
-
-result;
\ No newline at end of file
diff --git a/src/test/resources/initial-content/apps/graphql/test/one/GQLschema.jsp b/src/test/resources/initial-content/apps/graphql/test/one/GQLschema.jsp
index c1a00bb..ff09228 100644
--- a/src/test/resources/initial-content/apps/graphql/test/one/GQLschema.jsp
+++ b/src/test/resources/initial-content/apps/graphql/test/one/GQLschema.jsp
@@ -25,7 +25,7 @@ directive @fetcher(
 ) on FIELD_DEFINITION
 
 type Query {
-  scriptedSchemaResource : SlingResource @fetcher(name:"test/pipe" source:"$")
+  oneSchemaResource : SlingResource @fetcher(name:"test/pipe" source:"$")
 }
 
 type SlingResource { 
diff --git a/src/test/resources/initial-content/apps/graphql/test/one/json.gql b/src/test/resources/initial-content/apps/graphql/test/one/json.gql
index cc25dd7..da98c1d 100644
--- a/src/test/resources/initial-content/apps/graphql/test/one/json.gql
+++ b/src/test/resources/initial-content/apps/graphql/test/one/json.gql
@@ -16,4 +16,4 @@
 # * under the License.
 
 # Define the query for this resource type, selector and extension
-{ scriptedSchemaResource { path resourceType } }
\ No newline at end of file
+{ oneSchemaResource { path resourceType } }
\ No newline at end of file
diff --git a/src/test/resources/initial-content/apps/graphql/test/one/scripted.GQLschema.jsp b/src/test/resources/initial-content/apps/graphql/test/one/scripted.GQLschema.jsp
deleted file mode 100644
index 2dc9457..0000000
--- a/src/test/resources/initial-content/apps/graphql/test/one/scripted.GQLschema.jsp
+++ /dev/null
@@ -1,41 +0,0 @@
-<%-- 
-* 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.
---%>
-
-# This directive maps fields to our Sling data fetchers
-directive @fetcher(
-    name : String,
-    options : String = "",
-    source : String = ""
-) on FIELD_DEFINITION
-
-type Query {
-  currentResource : SlingResource @fetcher(name:"test/pipe" source:"$")
-  scriptedFetcher (testing : String = "NOT_SET") : Test @fetcher(name:"scripted/example")
-}
-
-type SlingResource { 
-  resourceType: String
-}
-
-type Test { 
-  boolValue: Boolean
-  resourcePath: String
-  testingArgument: String
-  anotherValue: Int
-}
\ No newline at end of file
diff --git a/src/test/resources/initial-content/apps/graphql/test/one/scripted.json.gql b/src/test/resources/initial-content/apps/graphql/test/one/scripted.json.gql
deleted file mode 100644
index 34215ac..0000000
--- a/src/test/resources/initial-content/apps/graphql/test/one/scripted.json.gql
+++ /dev/null
@@ -1,29 +0,0 @@
-# * 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.
-
-# Define the query for this resource type, selector and extension
-{ 
-    currentResource {
-        resourceType
-    }
-    scriptedFetcher (testing: "1,2,42") { 
-        boolValue
-        resourcePath
-        testingArgument
-        anotherValue
-    } 
-}
\ No newline at end of file
diff --git a/src/test/resources/initial-content/apps/graphql/test/two/scripted.GQLschema.jsp b/src/test/resources/initial-content/apps/graphql/test/two/scripted.GQLschema.jsp
deleted file mode 100644
index 28b9afc..0000000
--- a/src/test/resources/initial-content/apps/graphql/test/two/scripted.GQLschema.jsp
+++ /dev/null
@@ -1,40 +0,0 @@
-<%-- 
-* 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.
---%>
-
-# This directive maps fields to our Sling data fetchers
-directive @fetcher(
-    name : String,
-    options : String = "",
-    source : String = ""
-) on FIELD_DEFINITION
-
-type Query {
-    currentResource : SlingResource @fetcher(name:"test/pipe" source:"$")
-    scriptedFetcher (testing : String = "NOT_SET") : Test @fetcher(name:"scripted/example")
-}
-
-type SlingResource { 
-    path: String
-}
-
-type Test { 
-    boolValue: Boolean
-    resourcePath: String
-    testingArgument: String
-}
\ No newline at end of file
diff --git a/src/test/resources/test-schema.txt b/src/test/resources/test-schema.txt
index 0bcaa5d..230bc24 100644
--- a/src/test/resources/test-schema.txt
+++ b/src/test/resources/test-schema.txt
@@ -28,8 +28,6 @@ type Query {
 
     # Test some static values
     staticContent: Test @fetcher(name:"test/static")
-
-    scriptedFetcher (testing : String) : Test @fetcher(name:"scripted/example")
 }
 
 # This should be omitted from the SlingResource type description