diff options
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/query/profile/config/test/MultiProfileTestCase.java')
-rw-r--r-- | container-search/src/test/java/com/yahoo/search/query/profile/config/test/MultiProfileTestCase.java | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/query/profile/config/test/MultiProfileTestCase.java b/container-search/src/test/java/com/yahoo/search/query/profile/config/test/MultiProfileTestCase.java index 21f20e70ddb..ebe9c9d3c04 100644 --- a/container-search/src/test/java/com/yahoo/search/query/profile/config/test/MultiProfileTestCase.java +++ b/container-search/src/test/java/com/yahoo/search/query/profile/config/test/MultiProfileTestCase.java @@ -7,10 +7,10 @@ import java.util.Map; import com.yahoo.search.query.profile.QueryProfile; import com.yahoo.search.query.profile.QueryProfileRegistry; import com.yahoo.search.query.profile.config.QueryProfileXMLReader; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; /** * @author bratseth @@ -18,31 +18,31 @@ import static org.junit.Assert.assertNotNull; public class MultiProfileTestCase { @Test - public void testValid() { - QueryProfileRegistry registry= + void testValid() { + QueryProfileRegistry registry = new QueryProfileXMLReader().read("src/test/java/com/yahoo/search/query/profile/config/test/multiprofile"); - QueryProfile multiprofile1=registry.getComponent("multiprofile1"); + QueryProfile multiprofile1 = registry.getComponent("multiprofile1"); assertNotNull(multiprofile1); - assertGet("general-a","a",new String[] {null,null,null},multiprofile1); - assertGet("us-nokia-test1-a","a",new String[] {"us","nok ia","test1"},multiprofile1); - assertGet("us-nokia-b","b",new String[] {"us","nok ia","test1"},multiprofile1); - assertGet("us-a","a",new String[] {"us",null,null},multiprofile1); - assertGet("us-b","b",new String[] {"us",null,null},multiprofile1); - assertGet("us-nokia-a","a",new String[] {"us","nok ia",null},multiprofile1); - assertGet("us-test1-a","a",new String[] {"us",null,"test1"},multiprofile1); - assertGet("us-test1-b","b",new String[] {"us",null,"test1"},multiprofile1); + assertGet("general-a", "a", new String[]{null, null, null}, multiprofile1); + assertGet("us-nokia-test1-a", "a", new String[]{"us", "nok ia", "test1"}, multiprofile1); + assertGet("us-nokia-b", "b", new String[]{"us", "nok ia", "test1"}, multiprofile1); + assertGet("us-a", "a", new String[]{"us", null, null}, multiprofile1); + assertGet("us-b", "b", new String[]{"us", null, null}, multiprofile1); + assertGet("us-nokia-a", "a", new String[]{"us", "nok ia", null}, multiprofile1); + assertGet("us-test1-a", "a", new String[]{"us", null, "test1"}, multiprofile1); + assertGet("us-test1-b", "b", new String[]{"us", null, "test1"}, multiprofile1); - assertGet("us-a","a",new String[] {"us","unspecified","unspecified"},multiprofile1); - assertGet("us-nokia-a","a",new String[] {"us","nok ia","unspecified"},multiprofile1); - assertGet("us-test1-a","a",new String[] {"us","unspecified","test1"},multiprofile1); - assertGet("us-nokia-b","b",new String[] {"us","nok ia","test1"},multiprofile1); + assertGet("us-a", "a", new String[]{"us", "unspecified", "unspecified"}, multiprofile1); + assertGet("us-nokia-a", "a", new String[]{"us", "nok ia", "unspecified"}, multiprofile1); + assertGet("us-test1-a", "a", new String[]{"us", "unspecified", "test1"}, multiprofile1); + assertGet("us-nokia-b", "b", new String[]{"us", "nok ia", "test1"}, multiprofile1); // ...inherited - assertGet("parent1-value","parent1",new String[] { "us","nok ia","-" }, multiprofile1); - assertGet("parent2-value","parent2",new String[] { "us","nok ia","-" }, multiprofile1); - assertGet(null,"parent1",new String[] { "us","-","-" }, multiprofile1); - assertGet(null,"parent2",new String[] { "us","-","-" }, multiprofile1); + assertGet("parent1-value", "parent1", new String[]{"us", "nok ia", "-"}, multiprofile1); + assertGet("parent2-value", "parent2", new String[]{"us", "nok ia", "-"}, multiprofile1); + assertGet(null, "parent1", new String[]{"us", "-", "-"}, multiprofile1); + assertGet(null, "parent2", new String[]{"us", "-", "-"}, multiprofile1); } private void assertGet(String expectedValue,String parameter,String[] dimensionValues,QueryProfile profile) { @@ -50,7 +50,7 @@ public class MultiProfileTestCase { context.put("region",dimensionValues[0]); context.put("model",dimensionValues[1]); context.put("bucket",dimensionValues[2]); - assertEquals("Looking up '" + parameter + "' for '" + toString(dimensionValues) + "'",expectedValue,profile.get(parameter,context,null)); + assertEquals(expectedValue,profile.get(parameter,context,null),"Looking up '" + parameter + "' for '" + toString(dimensionValues) + "'"); } private String toString(String[] array) { |