summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2019-10-28 11:15:24 +0100
committerTor Egge <Tor.Egge@broadpark.no>2019-10-28 11:15:24 +0100
commit36f1cfadadad543b04877953f8f9dc4d1888b45d (patch)
tree0a093254ef8d2fe3f936905201c7c8934e46e748 /config-model
parent6e2cf6330c05859672cd9e72ef0c667215969bb3 (diff)
Use TestUtil.joinLines to simplify generation of multi-line string.
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java49
1 files changed, 26 insertions, 23 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java
index 41b3028e06c..71b4db60886 100644
--- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java
+++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/SummaryConsistencyTestCase.java
@@ -7,35 +7,38 @@ import com.yahoo.searchdefinition.parser.ParseException;
import com.yahoo.vespa.documentmodel.SummaryTransform;
import org.junit.Test;
+import static com.yahoo.config.model.test.TestUtil.joinLines;
import static org.junit.Assert.assertEquals;
public class SummaryConsistencyTestCase {
@Test
public void attribute_combiner_transform_is_set_when_source_is_array_of_struct_with_only_struct_field_attributes() throws ParseException {
- String sd = "search structmemorysummary {\n" +
- " document structmemorysummary {\n" +
- " struct elem {\n" +
- " field name type string {}\n" +
- " field weight type int {}\n" +
- " }\n" +
- " field elem_array type array<elem> {\n" +
- " indexing: summary\n" +
- " struct-field name {\n" +
- " indexing: attribute\n" +
- " }\n" +
- " struct-field weight {\n" +
- " indexing: attribute\n" +
- " }\n" +
- " }\n" +
- " }\n" +
- " document-summary unfiltered {\n" +
- " summary elem_array_unfiltered type array<elem> {\n" +
- " source: elem_array\n" +
- " }\n" +
- " }\n" +
- "\n" +
- "}";
+ String sd = joinLines(
+ "search structmemorysummary {",
+ " document structmemorysummary {",
+ " struct elem {",
+ " field name type string {}",
+ " field weight type int {}\n",
+ " }",
+ " field elem_array type array<elem> {",
+ " indexing: summary",
+ " struct-field name {",
+ " indexing: attribute",
+ " }",
+ " struct-field weight {",
+ " indexing: attribute",
+ " }",
+ " }",
+ " }",
+ " document-summary unfiltered {",
+ " summary elem_array_unfiltered type array<elem> {",
+ " source: elem_array",
+ " }",
+ " }",
+ "",
+ "}"
+ );
Search search = SearchBuilder.createFromString(sd).getSearch();
assertEquals(SummaryTransform.ATTRIBUTECOMBINER, search.getSummaryField("elem_array_unfiltered").getTransform());
}