diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-10-15 14:53:46 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-10-15 14:53:46 +0200 |
commit | e26f77c447678f0be63ad1b49762e1e22b2f2377 (patch) | |
tree | 88b26eb72f37943cafad51791c50861980cab788 /container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java | |
parent | a42bb2fc386f8e9145f2ada76ff0c5b32af17263 (diff) |
Clean up ugly code
Diffstat (limited to 'container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java')
-rw-r--r-- | container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java b/container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java index cc7173674a7..2b414421810 100644 --- a/container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java +++ b/container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java @@ -33,6 +33,7 @@ import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * Tests using synthetic index names for IndexFacts class. @@ -257,15 +258,14 @@ public class IndexFactsTestCase { new Indexinfo.Builder().name("music").command( new Command.Builder().indexname("title") .command("index")))); - IndexModel m = new IndexModel(cfg, (QrSearchersConfig)null); - assertNotNull(m.getSearchDefinitions().get("music").getIndex("title")); - assertNull(m.getSearchDefinitions().get("music").getIndex("btitle")); - assertNotNull(m.getSearchDefinitions().get("music2").getIndex("btitle")); - assertNotNull(m.getSearchDefinitions().get("music2").getIndex("title")); - assertSame(m.getSearchDefinitions().get("music2").getIndex("btitle"), - m.getSearchDefinitions().get("music2").getIndex("title")); - assertNotSame(m.getSearchDefinitions().get("music").getIndex("title"), - m.getSearchDefinitions().get("music2").getIndex("title")); + try { + new IndexModel(cfg, (QrSearchersConfig) null); + fail("Excepted exception"); // (This is validated at deploy time) + } + catch (IllegalArgumentException e) { + assertEquals("Tried adding the alias 'title' for the index name 'btitle' when the name 'title' already maps to 'title'", + e.getMessage()); + } } private Query newQuery(String queryString, IndexFacts indexFacts) { |