diff options
author | Vegard Sjonfjell <vegard@yahoo-inc.com> | 2016-10-05 15:30:57 +0200 |
---|---|---|
committer | Vegard Sjonfjell <vegard@yahoo-inc.com> | 2016-10-05 15:30:57 +0200 |
commit | 23cd65bb2d4a25f2d52a70f573ce4a3e25ee6b8c (patch) | |
tree | 0f77181a8e2d36540a4ea00b456d00adbe91e607 /vespa-http-client | |
parent | 4ff27fe8063bbe8079d7ddcb49fb1cccaf6d633c (diff) |
Move JsonTestHelper to testutil
Diffstat (limited to 'vespa-http-client')
-rw-r--r-- | vespa-http-client/pom.xml | 6 | ||||
-rw-r--r-- | vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/JsonReaderTest.java | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/vespa-http-client/pom.xml b/vespa-http-client/pom.xml index 9e2325e8016..563e4406fe9 100644 --- a/vespa-http-client/pom.xml +++ b/vespa-http-client/pom.xml @@ -83,6 +83,12 @@ <artifactId>airline</artifactId> <version>0.6</version> </dependency> + <dependency> + <groupId>com.yahoo.vespa</groupId> + <artifactId>testutil</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> </dependencies> <build> <plugins> diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/JsonReaderTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/JsonReaderTest.java index ab7dca0d5fb..eba8791bbb7 100644 --- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/JsonReaderTest.java +++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/JsonReaderTest.java @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.http.client.runner; -import com.google.common.base.Joiner; import com.yahoo.vespa.http.client.FeedClient; import com.yahoo.vespa.http.client.core.JsonReader; import org.junit.Test; @@ -13,6 +12,7 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import static com.yahoo.test.json.JsonTestHelper.inputJson; import static org.hamcrest.core.Is.is; import static org.junit.Assert.*; @@ -260,13 +260,4 @@ public class JsonReaderTest { assertThat(session.documentIds.size(), is(1)); assertThat(session.documentIds.get(0), is("id:foo:music:doc:foo:bar")); } - - /** - * Convenience method to input JSON without escaping double quotes and newlines - * Each parameter represents a line of JSON encoded data - * The lines are joined with newline and single quotes are replaced with double quotes - */ - static String inputJson(String... lines) { - return Joiner.on("\n").join(lines).replaceAll("'", "\""); - } }
\ No newline at end of file |