summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2019-01-15 10:25:49 +0100
committerGitHub <noreply@github.com>2019-01-15 10:25:49 +0100
commitcbe9b4e670834488c5b754d7aa3c8730d753ce4b (patch)
treef8ede0ad05a855b71c64fab093a1400409b7c576 /container-search/src/test/java/com
parent650467957862a1cc50b566f8841d8bffc7a60ff0 (diff)
parent27e1e811df19e5987c9126a3dadbceef9aa0ab58 (diff)
Merge pull request #8110 from vespa-engine/bratseth/disallow-dash
Bratseth/disallow dash
Diffstat (limited to 'container-search/src/test/java/com')
-rw-r--r--container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java b/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java
index ed80c0bf256..dae6b9f0fb9 100644
--- a/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java
+++ b/container-search/src/test/java/com/yahoo/search/test/QueryTestCase.java
@@ -308,6 +308,17 @@ public class QueryTestCase {
}
@Test
+ public void testLanguageSubstitution() {
+ QueryProfile profile = new QueryProfile("myProfile");
+ profile.set("myField1", "Language: %{model.language}", null);
+ profile.set("myField2", "Locale: %{locale}", null);
+ Query q = new Query(QueryTestCase.httpEncode("/search?lang=en-us"), profile.compile(null));
+ assertEquals("Language: ENGLISH", q.properties().get("myField1"));
+ q.properties().set("locale", q.getHttpRequest().propertyMap().get("lang"));
+ assertEquals("Locale: en-us", q.properties().get("myField2"));
+ }
+
+ @Test
public void testTimeoutInRequestOverridesQueryProfile() {
QueryProfile profile = new QueryProfile("test");
profile.set("timeout", 318, (QueryProfileRegistry)null);