summaryrefslogtreecommitdiffstats
path: root/document/src/test/java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-06-12 15:52:08 +0200
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2017-06-12 15:52:08 +0200
commit516e29bdca064509ea4350c4ce5308af51b3bbf0 (patch)
treec195dfea6d7e4791b6ee81d29f60d2755412ca62 /document/src/test/java
parent6b4508315257ca0ac80da1b90abb048cc7305895 (diff)
Use static final field instead of method for compressable string
Diffstat (limited to 'document/src/test/java')
-rw-r--r--document/src/test/java/com/yahoo/document/serialization/VespaDocumentSerializerTestCase.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/document/src/test/java/com/yahoo/document/serialization/VespaDocumentSerializerTestCase.java b/document/src/test/java/com/yahoo/document/serialization/VespaDocumentSerializerTestCase.java
index ba8cf655eec..3e742c9e618 100644
--- a/document/src/test/java/com/yahoo/document/serialization/VespaDocumentSerializerTestCase.java
+++ b/document/src/test/java/com/yahoo/document/serialization/VespaDocumentSerializerTestCase.java
@@ -2,6 +2,7 @@
package com.yahoo.document.serialization;
import com.yahoo.compress.CompressionType;
+import com.yahoo.compress.Compressor;
import com.yahoo.document.CompressionConfig;
import com.yahoo.document.DataType;
import com.yahoo.document.Document;
@@ -57,6 +58,9 @@ public class VespaDocumentSerializerTestCase {
}
static class CompressionFixture {
+
+ static final String COMPRESSABLE_STRING = "zippy zip mc zippington the 3rd zippy zip";
+
final DocumentTypeManager manager;
final DocumentType docType;
final StructDataType nestedType;
@@ -86,10 +90,6 @@ public class VespaDocumentSerializerTestCase {
Document roundtripSerialize(Document inputDoc) {
return manager.createDocument(asSerialized(inputDoc));
}
-
- String compressableString() {
- return "zippy zip mc zippington the 3rd zippy zip";
- }
}
@Test
@@ -98,7 +98,7 @@ public class VespaDocumentSerializerTestCase {
Document doc = new Document(fixture.docType, "id:foo:map_of_structs::flarn");
Struct nested = new Struct(fixture.nestedType);
- nested.setFieldValue("str", new StringFieldValue(fixture.compressableString()));
+ nested.setFieldValue("str", new StringFieldValue(CompressionFixture.COMPRESSABLE_STRING));
MapFieldValue<StringFieldValue, Struct> map = new MapFieldValue<StringFieldValue, Struct>(fixture.mapType);
map.put(new StringFieldValue("foo"), nested);
@@ -116,7 +116,7 @@ public class VespaDocumentSerializerTestCase {
Document doc = new Document(fixture.docType, "id:foo:map_of_structs::flarn");
Struct nested = new Struct(fixture.nestedType);
- nested.setFieldValue("str", new StringFieldValue(fixture.compressableString()));
+ nested.setFieldValue("str", new StringFieldValue(CompressionFixture.COMPRESSABLE_STRING));
MapFieldValue<StringFieldValue, Struct> map = new MapFieldValue<StringFieldValue, Struct>(fixture.mapType);
// Only 1 struct added. Not enough redundant information that header struct containing map itself