From 2852c75009353bed9c0456f6dd0c5c1f7d96df39 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Fri, 8 Mar 2024 14:23:26 +0100 Subject: Send schema name down to backend as library parameter. --- .../streamingvisitors/StreamingVisitorTest.java | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'container-search/src/test') diff --git a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/StreamingVisitorTest.java b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/StreamingVisitorTest.java index 8be60b7c3b0..afc78cf00ed 100644 --- a/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/StreamingVisitorTest.java +++ b/container-search/src/test/java/com/yahoo/vespa/streamingvisitors/StreamingVisitorTest.java @@ -23,6 +23,7 @@ import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import static org.junit.jupiter.api.Assertions.*; @@ -76,7 +77,7 @@ public class StreamingVisitorTest { }; } - private class QueryArguments { + private static class QueryArguments { // General query parameters String query = "test"; double timeout = 0.5; @@ -202,11 +203,7 @@ public class StreamingVisitorTest { } assertEquals(qa.from, params.getFromTimestamp()); assertEquals(qa.to, params.getToTimestamp()); - if (qa.priority != null) { - assertEquals(qa.priority, params.getPriority()); - } else { - assertEquals(DocumentProtocol.Priority.VERY_HIGH, params.getPriority()); - } + assertEquals(Objects.requireNonNullElse(qa.priority, DocumentProtocol.Priority.VERY_HIGH), params.getPriority()); if (qa.maxBucketsPerVisitor != 0) { assertEquals(qa.maxBucketsPerVisitor, params.getMaxBucketsPerVisitor()); } else { @@ -227,17 +224,10 @@ public class StreamingVisitorTest { //System.err.println("query="+new String(params.getLibraryParameters().get("querystackcount"))); assertNotNull(params.getLibraryParameters().get("querystackcount")); // TODO: Check contents assertEquals(searchCluster, new String(params.getLibraryParameters().get("searchcluster"))); - if (qa.summary != null) { - assertEquals(qa.summary, new String(params.getLibraryParameters().get("summaryclass"))); - } else { - assertEquals("default", new String(params.getLibraryParameters().get("summaryclass"))); - } + assertEquals(docType, new String(params.getLibraryParameters().get("schema"))); + assertEquals(Objects.requireNonNullElse(qa.summary, "default"), new String(params.getLibraryParameters().get("summaryclass"))); assertEquals(Integer.toString(qa.offset+qa.hits), new String(params.getLibraryParameters().get("summarycount"))); - if (qa.profile != null) { - assertEquals(qa.profile, new String(params.getLibraryParameters().get("rankprofile"))); - } else { - assertEquals("default", new String(params.getLibraryParameters().get("rankprofile"))); - } + assertEquals(Objects.requireNonNullElse(qa.profile, "default"), new String(params.getLibraryParameters().get("rankprofile"))); //System.err.println("queryflags="+new String(params.getLibraryParameters().get("queryflags"))); assertNotNull(params.getLibraryParameters().get("queryflags")); // TODO: Check contents if (qa.location != null) { -- cgit v1.2.3