diff --git a/core/Changes b/core/Changes
index 611af1f..cab5c5b 100644
--- a/core/Changes
+++ b/core/Changes
@@ -1,5 +1,9 @@
 # version 0.63
-
+14/01/2021
+   - Updated Flyway (margaretha)
+21/01/2021
+   - Fixed running pipe and updated tests with mockserver (margaretha)
+   
 # version 0.62.4
 24/01/2020
    - Removed salt from config and updated config files.
diff --git a/core/pom.xml b/core/pom.xml
index 59a689b..a14de06 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -1,5 +1,5 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>de.ids_mannheim.korap</groupId>
 	<artifactId>Kustvakt-core</artifactId>
@@ -63,19 +63,18 @@
 
 			<!-- build tests jar, so extensions can use fastjerseytest class to build 
 				rest tests -->
-			<!-- <plugin>
+			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-jar-plugin</artifactId>
-				<version>3.0.2</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
-						<phase>package</phase>
 						<goals>
 							<goal>test-jar</goal>
 						</goals>
 					</execution>
 				</executions>
-			</plugin> -->
+			</plugin>
 			
 			<!-- Generate source jar -->
 			<plugin>
@@ -252,6 +251,10 @@
 			<version>[0.37,)</version>
 			<exclusions>
 				<exclusion>
+					<groupId>org.sonatype.sisu</groupId>
+					<artifactId>sisu-guava</artifactId>
+				</exclusion>
+				<exclusion>
 					<groupId>org.eclipse.jetty</groupId>
 					<artifactId>jetty-servlet</artifactId>
 				</exclusion>
@@ -494,7 +497,6 @@
 			<version>0.1.0</version>
 		</dependency>
 		
-		
 		<dependency>
 			<groupId>javax.servlet</groupId>
 			<artifactId>javax.servlet-api</artifactId>
diff --git a/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java b/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
index 2ec9040..647009d 100644
--- a/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
+++ b/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
@@ -6,7 +6,9 @@
 import java.io.OutputStreamWriter;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
 import java.security.NoSuchAlgorithmException;
+import java.util.Scanner;
 
 import javax.servlet.ServletContextListener;
 
@@ -19,7 +21,6 @@
 import org.eclipse.jetty.servlet.ServletHolder;
 import org.springframework.web.context.ContextLoaderListener;
 
-import com.google.common.io.Files;
 import com.sun.jersey.spi.spring.container.servlet.SpringServlet;
 
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
@@ -90,8 +91,9 @@
             writer.close();
         }
         else {
-            adminToken = Files.readFirstLine(f, Charset.forName("utf-8"))
-                    .substring(6);
+            Scanner scanner = new Scanner(f);
+            adminToken = scanner.nextLine().substring(6);
+            scanner.close();
         }
 
         Server server = new Server();
diff --git a/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java b/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
index 28c526d..43114cb 100644
--- a/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
+++ b/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
@@ -1,5 +1,10 @@
 package de.ids_mannheim.korap.service;
 
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
@@ -8,7 +13,6 @@
 import javax.annotation.PostConstruct;
 import javax.servlet.ServletContext;
 import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriBuilder;
 
@@ -21,9 +25,6 @@
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 
 import de.ids_mannheim.de.init.VCLoader;
@@ -207,22 +208,36 @@
             for (int i=0; i<pipeArray.length; i++){
                 String pipeURL = pipeArray[i];
                 try {
-                    Client client = Client.create();
-                    WebResource resource = client.resource(pipeURL);
-                    ClientResponse response =
-                            resource.type(MediaType.APPLICATION_JSON)
-                                    .accept(MediaType.APPLICATION_JSON)
-                                    .post(ClientResponse.class, query);
-                    if (response.getStatus() == HttpStatus.SC_OK) {
-                        String entity = response.getEntity(String.class);
-                        if (entity != null && !entity.isEmpty()) {
-                            query = entity;
+                    URL url = new URL(pipeURL);
+                    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+                    connection.setRequestMethod("POST");
+                    connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
+                    connection.setRequestProperty("Accept", "application/json");
+                    connection.setDoOutput(true);
+                    OutputStream os = connection.getOutputStream();
+                    byte[] input = query.getBytes("utf-8");
+                    os.write(input, 0, input.length);     
+                    
+                    String entity = null;
+                    if (connection.getResponseCode() == HttpStatus.SC_OK) {
+                        BufferedReader br =
+                                new BufferedReader(new InputStreamReader(
+                                        connection.getInputStream(), "utf-8"));
+                        StringBuilder response = new StringBuilder();
+                        String responseLine = null;
+                        while ((responseLine = br.readLine()) != null) {
+                            response.append(responseLine.trim());
                         }
+                        entity = response.toString();
+                    }
+
+                    if (entity != null && !entity.isEmpty()) {
+                        query = entity;
                     }
                     else {
                         query = handlePipeError(query, pipeURL,
-                                response.getStatus() + " "
-                                        + response.getStatusInfo().toString());
+                                connection.getResponseCode() + " "
+                                        + connection.getResponseMessage());
                     }
                 }
                 catch (Exception e) {
diff --git a/core/src/main/java/de/ids_mannheim/korap/test/TestController.java b/core/src/main/java/de/ids_mannheim/korap/test/TestController.java
deleted file mode 100644
index 03b8f96..0000000
--- a/core/src/main/java/de/ids_mannheim/korap/test/TestController.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package de.ids_mannheim.korap.test;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.web.KustvaktResponseHandler;
-
-/**
- * Controllers used only for testing
- * 
- * @author margaretha
- *
- */
-@Controller
-@Path("/{version}/test")
-@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
-public class TestController {
-
-    @Autowired
-    private KustvaktResponseHandler kustvaktResponseHandler;
-
-    public static ObjectMapper mapper = new ObjectMapper();
-
-    @POST
-    @Path("glemm")
-    @Consumes(MediaType.APPLICATION_JSON)
-    public Response dummyGlemm (String jsonld,
-            @QueryParam("param") String param) throws IOException {
-        InputStream is;
-        is = getClass().getClassLoader()
-                .getResourceAsStream("test-pipes.jsonld");
-
-        ObjectNode newJson = (ObjectNode) mapper.readTree(is);
-
-        try {
-            JsonNode node = JsonUtils.readTree(jsonld);
-            if (node.has("warnings")) {
-                node = node.get("warnings");
-                newJson.set("warnings", node);
-            }
-            if (param != null && !param.isEmpty()) {
-                ArrayNode keys = (ArrayNode) newJson.at("/query/wrap/key");
-                keys.add("die");
-                newJson.set("key", keys);
-            }
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok(newJson.toString()).build();
-    }
-
-    @POST
-    @Path("invalid-json-pipe")
-    @Consumes(MediaType.APPLICATION_JSON)
-    public Response dummyPipe1 (String jsonld) {
-        String incorrectJson = "{blah:}";
-        return Response.ok(incorrectJson).build();
-    }
-
-    @POST
-    @Path("plain-response-pipe")
-    @Consumes(MediaType.APPLICATION_JSON)
-    public Response dummyPipe2 (String jsonld) {
-        String incorrectJson = "brumbrum";
-        return Response.ok(incorrectJson).build();
-    }
-
-    @POST
-    @Path("urlencoded-pipe")
-    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
-    public Response dummyPipe3 (String jsonld) {
-        return Response.ok().build();
-    }
-}
diff --git a/core/src/main/resources/test-pipes.jsonld b/core/src/test/resources/pipe-output/test-pipes.jsonld
similarity index 100%
rename from core/src/main/resources/test-pipes.jsonld
rename to core/src/test/resources/pipe-output/test-pipes.jsonld
diff --git a/core/src/test/resources/pipe-output/with-param.jsonld b/core/src/test/resources/pipe-output/with-param.jsonld
new file mode 100644
index 0000000..08c7fda
--- /dev/null
+++ b/core/src/test/resources/pipe-output/with-param.jsonld
@@ -0,0 +1,29 @@
+{
+    "meta": {
+        "snippets": true,
+        "timeout": 10000
+    },
+    "query": {
+        "@type": "koral:token",
+        "wrap": {
+            "@type": "koral:term",
+            "match": "match:eq",
+            "key": [
+                "der",
+                "das",
+		"die"
+            ],
+            "layer": "orth",
+            "rewrites": [
+                {
+                    "@type": "koral:rewrite",
+                    "src": "Glemm",
+                    "operation": "operation:override",
+                    "scope": "key"
+                }
+            ]
+        }
+    },
+    "@context": "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld"
+}
+
diff --git a/full/Changes b/full/Changes
index b604b95..40f20af 100644
--- a/full/Changes
+++ b/full/Changes
@@ -9,6 +9,10 @@
    - Fix hibernate dialect for SQLite. (margaretha)
 04/12/2020
    - Fix pipe warning. (margaretha)
+14/01/2021
+   - Updated Flyway (margaretha)
+21/01/2021
+   - Fixed running pipe and updated tests with mockserver (margaretha)
 
 # version 0.62.4
 24/01/2020
diff --git a/full/pom.xml b/full/pom.xml
index d083b8c..407a212 100644
--- a/full/pom.xml
+++ b/full/pom.xml
@@ -205,7 +205,15 @@
 		<dependency>
 			<groupId>de.ids_mannheim.korap</groupId>
 			<artifactId>Kustvakt-core</artifactId>
-			<version>[0.62.4,)</version>
+			<version>[0.63.,)</version>
+		</dependency>
+		<dependency>
+			<groupId>de.ids_mannheim.korap</groupId>
+			<artifactId>Kustvakt-core</artifactId>
+			<version>[0.63.,)</version>
+			<classifier>tests</classifier>
+      		<type>test-jar</type>
+      		<scope>test</scope>
 		</dependency>
 		<!-- LDAP -->
 		<dependency>
@@ -324,5 +332,13 @@
 			<version>1.18.16</version>
 			<scope>provided</scope>
 		</dependency>
+		
+		<!-- Mockserver -->
+		<dependency>
+		    <groupId>org.mock-server</groupId>
+		    <artifactId>mockserver-netty</artifactId>
+		    <version>5.11.2</version>
+		    <scope>test</scope>
+		</dependency>
 	</dependencies>
 </project>
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java
index 7018a1a..99a6d86 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/SearchPipeTest.java
@@ -1,11 +1,28 @@
 package de.ids_mannheim.korap.web.controller;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockserver.integration.ClientAndServer.startClientAndServer;
+import static org.mockserver.model.HttpRequest.request;
+import static org.mockserver.model.HttpResponse.response;
 
+import java.io.BufferedReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URISyntaxException;
+import java.net.URL;
 import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 
+import org.apache.commons.io.IOUtils;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
+import org.mockserver.client.MockServerClient;
+import org.mockserver.integration.ClientAndServer;
+import org.mockserver.model.Header;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.ClientResponse;
@@ -17,10 +34,82 @@
 
 public class SearchPipeTest extends SpringJerseyTest {
 
+    private ClientAndServer mockServer;
+    private MockServerClient mockClient;
+
+    private String pipeJson, pipeWithParamJson;
+    private String glemmUri = "http://localhost:1080/glemm";
+
+    public SearchPipeTest () throws URISyntaxException, IOException {
+        pipeJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/test-pipes.jsonld"),
+                StandardCharsets.UTF_8);
+
+        pipeWithParamJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/with-param.jsonld"),
+                StandardCharsets.UTF_8);
+    }
+
+    @Before
+    public void startMockServer () {
+        mockServer = startClientAndServer(1080);
+        mockClient = new MockServerClient("localhost", mockServer.getPort());
+    }
+
+    @After
+    public void stopMockServer () {
+        mockServer.stop();
+    }
+
     @Test
-    public void testSearchWithPipes () throws IOException, KustvaktException {
-        String glemmUri =
-                resource().getURI().toString() + API_VERSION + "/test/glemm";
+    public void testMockServer () throws IOException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/test")
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody("{test}").withStatusCode(200));
+
+        URL url = new URL("http://localhost:1080/test");
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("POST");
+        connection.setRequestProperty("Content-Type",
+                "application/json; charset=UTF-8");
+        connection.setRequestProperty("Accept", "application/json");
+        connection.setDoOutput(true);
+
+        String json = "{\"name\" : \"dory\"}";
+        try (OutputStream os = connection.getOutputStream()) {
+            byte[] input = json.getBytes("utf-8");
+            os.write(input, 0, input.length);
+        }
+
+        assertEquals(200, connection.getResponseCode());
+
+        BufferedReader br = new BufferedReader(
+                new InputStreamReader(connection.getInputStream(), "utf-8"));
+        assertEquals("{test}", br.readLine());
+
+    }
+
+    @Test
+    public void testSearchWithPipes ()
+            throws IOException, KustvaktException, URISyntaxException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
                 .queryParam("pipes", glemmUri).get(ClientResponse.class);
@@ -49,13 +138,24 @@
         assertEquals("operation:injection", node.at("/1/operation").asText());
         assertEquals("foundry", node.at("/1/scope").asText());
     }
-    
+
     @Test
-    public void testSearchWithUrlEncodedPipes () throws IOException, KustvaktException {
-        String glemmUri =
-                resource().getURI().toString() + API_VERSION + "/test/glemm";
-        glemmUri = URLEncoder.encode(glemmUri,"utf-8");
-        
+    public void testSearchWithUrlEncodedPipes ()
+            throws IOException, KustvaktException {
+
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+
+        glemmUri = URLEncoder.encode(glemmUri, "utf-8");
+
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
                 .queryParam("pipes", glemmUri).get(ClientResponse.class);
@@ -67,8 +167,18 @@
 
     @Test
     public void testSearchWithMultiplePipes () throws KustvaktException {
-        String glemmUri =
-                resource().getURI().toString() + API_VERSION + "/test/glemm";
+
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withQueryStringParameter("param").withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeWithParamJson).withStatusCode(200));
+
         String glemmUri2 = glemmUri + "?param=blah";
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
@@ -98,6 +208,7 @@
 
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
+        assertEquals("404 Not Found", node.at("/warnings/0/3").asText());
     }
 
     @Test
@@ -113,15 +224,20 @@
         JsonNode node = JsonUtils.readTree(entity);
 
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
+        assertEquals("glemm", node.at("/warnings/0/3").asText());
     }
 
     @Test
-    public void testSearchWithUrlEncodedPipe () throws KustvaktException {
-        String pipe = resource().getURI().toString() + API_VERSION
-                + "/test/urlencoded-pipe";
+    public void testSearchUnsupportedMediaType () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/non-json-pipe"))
+                .respond(response().withStatusCode(415));
+
+        String pipeUri = "http://localhost:1080/non-json-pipe";
+
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .queryParam("pipes", pipe).get(ClientResponse.class);
+                .queryParam("pipes", pipeUri).get(ClientResponse.class);
 
         String entity = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
@@ -155,18 +271,26 @@
 
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/1/0").asInt());
         assertEquals("http://glemm", node.at("/warnings/1/2").asText());
-        assertEquals("java.net.UnknownHostException: glemm",
-                node.at("/warnings/1/3").asText());
+        assertEquals("glemm", node.at("/warnings/1/3").asText());
 
     }
 
     @Test
     public void testSearchWithInvalidJsonResponse () throws KustvaktException {
-        String pipe = resource().getURI().toString() + API_VERSION
-                + "/test/invalid-json-pipe";
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/invalid-response")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("{blah:}").withStatusCode(200)
+                        .withHeaders(new Header("Content-Type",
+                                "application/json; charset=utf-8")));
+
+        String pipeUri = "http://localhost:1080/invalid-response";
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .queryParam("pipes", pipe).get(ClientResponse.class);
+                .queryParam("pipes", pipeUri).get(ClientResponse.class);
 
         String entity = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
@@ -179,11 +303,18 @@
 
     @Test
     public void testSearchWithPlainTextResponse () throws KustvaktException {
-        String pipe = resource().getURI().toString() + API_VERSION
-                + "/test/plain-response-pipe";
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/plain-text")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("blah").withStatusCode(200));
+
+        String pipeUri = "http://localhost:1080/plain-text";
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .queryParam("pipes", pipe).get(ClientResponse.class);
+                .queryParam("pipes", pipeUri).get(ClientResponse.class);
 
         String entity = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
@@ -197,8 +328,18 @@
     @Test
     public void testSearchWithMultipleAndUnknownPipes ()
             throws KustvaktException {
-        String glemmUri =
-                resource().getURI().toString() + API_VERSION + "/test/glemm";
+
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
                 .queryParam("pipes", "http://unknown" + "," + glemmUri)
@@ -209,7 +350,19 @@
 
         String entity = response.getEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
         assertEquals(2, node.at("/query/wrap/key").size());
+        assertTrue(node.at("/warnings").isMissingNode());
+
+        response = resource().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri + ",http://unknown")
+                .get(ClientResponse.class);
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        entity = response.getEntity(String.class);
+        node = JsonUtils.readTree(entity);
+        assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
     }
 }
diff --git a/lite/Changes b/lite/Changes
index c9ccc2e..be5532b 100644
--- a/lite/Changes
+++ b/lite/Changes
@@ -1,6 +1,11 @@
 # version 0.63
 04/12/2020
   - Fix hibernate dialect for SQLite. (margaretha)
+14/01/2021
+   - Updated Flyway (margaretha)
+21/01/2021
+   - Fixed running pipe and updated tests with mockserver (margaretha)
+  
   
 # version 0.62.4
 24/01/2020
diff --git a/lite/pom.xml b/lite/pom.xml
index b40e638..46484fd 100644
--- a/lite/pom.xml
+++ b/lite/pom.xml
@@ -146,11 +146,26 @@
 
 
 	<dependencies>
+		<!-- Mockserver -->
+		<dependency>
+		    <groupId>org.mock-server</groupId>
+		    <artifactId>mockserver-netty</artifactId>
+		    <version>5.11.2</version>
+		    <scope>test</scope>
+		</dependency>
 		<dependency>
 			<groupId>de.ids_mannheim.korap</groupId>
 			<artifactId>Kustvakt-core</artifactId>
-			<version>[0.62.4,)</version>
+			<version>[0.63.,)</version>
 		</dependency>
+		<dependency>
+			<groupId>de.ids_mannheim.korap</groupId>
+			<artifactId>Kustvakt-core</artifactId>
+			<version>[0.63.,)</version>
+			<classifier>tests</classifier>
+      		<type>test-jar</type>
+      		<scope>test</scope>
+      	</dependency>	
 		<!-- Jersey test framework -->
 		<dependency>
 			<groupId>com.sun.jersey.jersey-test-framework</groupId>
@@ -178,6 +193,12 @@
 			<artifactId>cobertura-maven-plugin</artifactId>
 			<version>2.7</version>
 			<scope>test</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>org.apache.commons</groupId>
+					<artifactId>commons-lang3</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<!-- https://mvnrepository.com/artifact/backport-util-concurrent/backport-util-concurrent -->
 		<dependency>
diff --git a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchPipeTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchPipeTest.java
index 3f0c0bb..38e5f21 100644
--- a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchPipeTest.java
+++ b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchPipeTest.java
@@ -1,10 +1,28 @@
 package de.ids_mannheim.korap.web.service;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.mockserver.integration.ClientAndServer.startClientAndServer;
+import static org.mockserver.model.HttpRequest.request;
+import static org.mockserver.model.HttpResponse.response;
 
+import java.io.BufferedReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
 
+import org.apache.commons.io.IOUtils;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
+import org.mockserver.client.MockServerClient;
+import org.mockserver.integration.ClientAndServer;
+import org.mockserver.model.Header;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.ClientResponse;
@@ -16,10 +34,82 @@
 
 public class LiteSearchPipeTest extends LiteJerseyTest {
 
+    private ClientAndServer mockServer;
+    private MockServerClient mockClient;
+
+    private String pipeJson, pipeWithParamJson;
+    private String glemmUri = "http://localhost:1080/glemm";
+
+    public LiteSearchPipeTest () throws IOException{
+        pipeJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/test-pipes.jsonld"),
+                StandardCharsets.UTF_8);
+
+        pipeWithParamJson = IOUtils.toString(
+                ClassLoader.getSystemResourceAsStream(
+                        "pipe-output/with-param.jsonld"),
+                StandardCharsets.UTF_8);
+    }
+
+    @Before
+    public void startMockServer () {
+        mockServer = startClientAndServer(1080);
+        mockClient = new MockServerClient("localhost", mockServer.getPort());
+    }
+
+    @After
+    public void stopMockServer () {
+        mockServer.stop();
+    }
+
     @Test
-    public void testSearchWithPipes () throws IOException, KustvaktException {
-        String glemmUri =
-                resource().getURI().toString() + API_VERSION + "/test/glemm";
+    public void testMockServer () throws IOException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/test")
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody("{test}").withStatusCode(200));
+
+        URL url = new URL("http://localhost:1080/test");
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("POST");
+        connection.setRequestProperty("Content-Type",
+                "application/json; charset=UTF-8");
+        connection.setRequestProperty("Accept", "application/json");
+        connection.setDoOutput(true);
+
+        String json = "{\"name\" : \"dory\"}";
+        try (OutputStream os = connection.getOutputStream()) {
+            byte[] input = json.getBytes("utf-8");
+            os.write(input, 0, input.length);
+        }
+
+        assertEquals(200, connection.getResponseCode());
+
+        BufferedReader br = new BufferedReader(
+                new InputStreamReader(connection.getInputStream(), "utf-8"));
+        assertEquals("{test}", br.readLine());
+
+    }
+
+    @Test
+    public void testSearchWithPipes ()
+            throws IOException, KustvaktException, URISyntaxException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
                 .queryParam("pipes", glemmUri).get(ClientResponse.class);
@@ -28,9 +118,9 @@
                 response.getStatus());
 
         String entity = response.getEntity(String.class);
-
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(2, node.at("/query/wrap/key").size());
+
         node = node.at("/query/wrap/rewrites");
         assertEquals(2, node.size());
         assertEquals("Glemm", node.at("/0/src").asText());
@@ -43,9 +133,45 @@
     }
 
     @Test
+    public void testSearchWithUrlEncodedPipes ()
+            throws IOException, KustvaktException {
+
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+
+        glemmUri = URLEncoder.encode(glemmUri, "utf-8");
+
+        ClientResponse response = resource().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri).get(ClientResponse.class);
+
+        String entity = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(entity);
+        assertEquals(2, node.at("/query/wrap/key").size());
+    }
+
+    @Test
     public void testSearchWithMultiplePipes () throws KustvaktException {
-        String glemmUri =
-                resource().getURI().toString() + API_VERSION + "/test/glemm";
+
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withQueryStringParameter("param").withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeWithParamJson).withStatusCode(200));
+
         String glemmUri2 = glemmUri + "?param=blah";
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
@@ -75,6 +201,7 @@
 
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
+        assertEquals("404 Not Found", node.at("/warnings/0/3").asText());
     }
 
     @Test
@@ -90,15 +217,20 @@
         JsonNode node = JsonUtils.readTree(entity);
 
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
+        assertEquals("glemm", node.at("/warnings/0/3").asText());
     }
 
     @Test
-    public void testSearchWithUrlEncodedPipe () throws KustvaktException {
-        String pipe = resource().getURI().toString() + API_VERSION
-                + "/test/urlencoded-pipe";
+    public void testSearchUnsupportedMediaType () throws KustvaktException {
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/non-json-pipe"))
+                .respond(response().withStatusCode(415));
+
+        String pipeUri = "http://localhost:1080/non-json-pipe";
+
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .queryParam("pipes", pipe).get(ClientResponse.class);
+                .queryParam("pipes", pipeUri).get(ClientResponse.class);
 
         String entity = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
@@ -132,18 +264,26 @@
 
         assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/1/0").asInt());
         assertEquals("http://glemm", node.at("/warnings/1/2").asText());
-        assertEquals("java.net.UnknownHostException: glemm",
-                node.at("/warnings/1/3").asText());
+        assertEquals("glemm", node.at("/warnings/1/3").asText());
 
     }
 
     @Test
     public void testSearchWithInvalidJsonResponse () throws KustvaktException {
-        String pipe = resource().getURI().toString() + API_VERSION
-                + "/test/invalid-json-pipe";
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/invalid-response")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("{blah:}").withStatusCode(200)
+                        .withHeaders(new Header("Content-Type",
+                                "application/json; charset=utf-8")));
+
+        String pipeUri = "http://localhost:1080/invalid-response";
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .queryParam("pipes", pipe).get(ClientResponse.class);
+                .queryParam("pipes", pipeUri).get(ClientResponse.class);
 
         String entity = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
@@ -156,11 +296,18 @@
 
     @Test
     public void testSearchWithPlainTextResponse () throws KustvaktException {
-        String pipe = resource().getURI().toString() + API_VERSION
-                + "/test/plain-response-pipe";
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/plain-text")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response().withBody("blah").withStatusCode(200));
+
+        String pipeUri = "http://localhost:1080/plain-text";
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .queryParam("pipes", pipe).get(ClientResponse.class);
+                .queryParam("pipes", pipeUri).get(ClientResponse.class);
 
         String entity = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
@@ -174,8 +321,18 @@
     @Test
     public void testSearchWithMultipleAndUnknownPipes ()
             throws KustvaktException {
-        String glemmUri =
-                resource().getURI().toString() + API_VERSION + "/test/glemm";
+
+        mockClient.reset()
+                .when(request().withMethod("POST").withPath("/glemm")
+                        .withHeaders(
+                                new Header("Content-Type",
+                                        "application/json; charset=utf-8"),
+                                new Header("Accept", "application/json")))
+                .respond(response()
+                        .withHeader(new Header("Content-Type",
+                                "application/json; charset=utf-8"))
+                        .withBody(pipeJson).withStatusCode(200));
+
         ClientResponse response = resource().path(API_VERSION).path("search")
                 .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
                 .queryParam("pipes", "http://unknown" + "," + glemmUri)
@@ -186,7 +343,19 @@
 
         String entity = response.getEntity(String.class);
         JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
         assertEquals(2, node.at("/query/wrap/key").size());
+        assertTrue(node.at("/warnings").isMissingNode());
+
+        response = resource().path(API_VERSION).path("search")
+                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
+                .queryParam("pipes", glemmUri + ",http://unknown")
+                .get(ClientResponse.class);
+
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        entity = response.getEntity(String.class);
+        node = JsonUtils.readTree(entity);
+        assertEquals(StatusCodes.PIPE_FAILED, node.at("/warnings/0/0").asInt());
     }
 }
diff --git a/lite/src/test/java/de/ids_mannheim/korap/web/service/TestDummyServices.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/TestDummyServices.java
deleted file mode 100644
index 8e4e0d2..0000000
--- a/lite/src/test/java/de/ids_mannheim/korap/web/service/TestDummyServices.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientResponse;
-
-import de.ids_mannheim.korap.config.LiteJerseyTest;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.utils.JsonUtils;
-
-public class TestDummyServices extends LiteJerseyTest {
-
-    @Test
-    public void testGlemmService () throws KustvaktException {
-        ClientResponse response = resource().path(API_VERSION).path("test")
-                .path("glemm").post(ClientResponse.class);
-
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-
-        String entity = response.getEntity(String.class);
-
-        JsonNode node = JsonUtils.readTree(entity);
-        assertEquals(2, node.at("/query/wrap/key").size());
-        node = node.at("/query/wrap/rewrites");
-        assertEquals("Glemm", node.at("/0/src").asText());
-        assertEquals("operation:override", node.at("/0/operation").asText());
-        assertEquals("key", node.at("/0/scope").asText());
-    }
-}
