diff options
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/federation/sourceref')
2 files changed, 18 insertions, 22 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SearchChainResolverTestCase.java b/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SearchChainResolverTestCase.java index 34224721487..5a551fdcdee 100644 --- a/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SearchChainResolverTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SearchChainResolverTestCase.java @@ -10,15 +10,13 @@ import com.yahoo.search.federation.sourceref.SearchChainResolver; import com.yahoo.search.federation.sourceref.Target; import com.yahoo.search.federation.sourceref.UnresolvedSearchChainException; import com.yahoo.search.searchchain.model.federation.FederationOptions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import java.util.Iterator; import java.util.SortedSet; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.*; /** * @author Tony Vaagenes @@ -53,7 +51,7 @@ public class SearchChainResolverTestCase { } @Test - public void check_default_search_chains() { + void check_default_search_chains() { assertEquals(2, searchChainResolver.defaultTargets().size()); Iterator<Target> iterator = searchChainResolver.defaultTargets().iterator(); @@ -62,7 +60,7 @@ public class SearchChainResolverTestCase { } @Test - public void require_error_message_for_invalid_source() { + void require_error_message_for_invalid_source() { try { resolve("no-such-source"); fail("Expected exception."); @@ -72,7 +70,7 @@ public class SearchChainResolverTestCase { } @Test - public void lookup_search_chain() throws Exception { + void lookup_search_chain() throws Exception { SearchChainInvocationSpec res = resolve(searchChainId.getName()); assertEquals(searchChainId, res.searchChainId); } @@ -86,13 +84,13 @@ public class SearchChainResolverTestCase { } @Test - public void lookup_source() throws Exception { + void lookup_source() throws Exception { SearchChainInvocationSpec res = resolve(sourceId.getName()); assertIsSourceInProvider(res); } @Test - public void lookup_source_search_chain_directly() throws Exception { + void lookup_source_search_chain_directly() throws Exception { SearchChainInvocationSpec res = resolve(sourceChainInProviderId.stringValue()); assertIsSourceInProvider(res); } @@ -104,7 +102,7 @@ public class SearchChainResolverTestCase { } @Test - public void lookup_source_for_provider2() throws Exception { + void lookup_source_for_provider2() throws Exception { SearchChainInvocationSpec res = resolve(sourceId.getName(), provider2Id.getName()); assertEquals(provider2Id, res.provider); assertEquals(sourceId, res.source); @@ -112,7 +110,7 @@ public class SearchChainResolverTestCase { } @Test - public void lists_source_ref_description_for_top_level_targets() { + void lists_source_ref_description_for_top_level_targets() { SortedSet<Target> topLevelTargets = searchChainResolver.allTopLevelTargets(); assertEquals(3, topLevelTargets.size()); diff --git a/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SourceRefResolverTestCase.java b/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SourceRefResolverTestCase.java index acb68175921..97c93ed09ed 100644 --- a/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SourceRefResolverTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/federation/sourceref/test/SourceRefResolverTestCase.java @@ -10,7 +10,7 @@ import com.yahoo.search.federation.sourceref.SearchChainResolver; import com.yahoo.search.federation.sourceref.SourceRefResolver; import com.yahoo.search.federation.sourceref.UnresolvedSearchChainException; import com.yahoo.search.searchchain.model.federation.FederationOptions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Collections; @@ -19,9 +19,7 @@ import java.util.Set; import java.util.TreeMap; import static com.yahoo.search.federation.sourceref.test.SearchChainResolverTestCase.emptySourceToProviderMap; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.*; /** * Test for SourceRefResolver. @@ -60,38 +58,38 @@ public class SourceRefResolverTestCase { } @Test - public void check_test_assumptions() { + void check_test_assumptions() { assertTrue(indexFacts.clustersHavingSearchDefinition("document1").containsAll(List.of("cluster1", "cluster2"))); } @Test - public void lookup_search_chain() throws Exception { + void lookup_search_chain() throws Exception { Set<SearchChainInvocationSpec> searchChains = resolve(cluster1); assertEquals(1, searchChains.size()); assertTrue(searchChainIds(searchChains).contains(cluster1)); } @Test - public void lookup_search_chains_for_document1() throws Exception { + void lookup_search_chains_for_document1() throws Exception { Set<SearchChainInvocationSpec> searchChains = resolve("document1"); assertEquals(2, searchChains.size()); assertTrue(searchChainIds(searchChains).containsAll(List.of(cluster1, cluster2))); } @Test - public void error_when_document_gives_cluster_without_matching_search_chain() { + void error_when_document_gives_cluster_without_matching_search_chain() { try { resolve("document3"); fail("Expected exception"); } catch (UnresolvedSearchChainException e) { assertEquals("Failed to resolve cluster search chain 'cluster3' " + - "when using source ref 'document3' as a document name.", - e.getMessage()); + "when using source ref 'document3' as a document name.", + e.getMessage()); } } @Test - public void error_when_no_document_or_search_chain() { + void error_when_no_document_or_search_chain() { try { resolve("document4"); fail("Expected exception"); |