diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/schema/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/schema/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/config-model/src/test/java/com/yahoo/schema/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java index 64b0a437b1d..4efd20a06f1 100644 --- a/config-model/src/test/java/com/yahoo/schema/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/processing/DisallowComplexMapAndWsetKeyTypesTestCase.java @@ -4,41 +4,53 @@ package com.yahoo.schema.processing; import com.yahoo.schema.RankProfileRegistry; import com.yahoo.schema.ApplicationBuilder; import com.yahoo.schema.parser.ParseException; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; /** * @author lesters */ public class DisallowComplexMapAndWsetKeyTypesTestCase { - @Test(expected = IllegalArgumentException.class) - public void requireThatComplexTypesForMapKeysFail() throws ParseException { - testFieldType("map<mystruct,string>"); + @Test + void requireThatComplexTypesForMapKeysFail() throws ParseException { + assertThrows(IllegalArgumentException.class, () -> { + testFieldType("map<mystruct,string>"); + }); } - @Test(expected = IllegalArgumentException.class) - public void requireThatComplexTypesForWsetFail() throws ParseException { - testFieldType("weightedset<mystruct>"); + @Test + void requireThatComplexTypesForWsetFail() throws ParseException { + assertThrows(IllegalArgumentException.class, () -> { + testFieldType("weightedset<mystruct>"); + }); } - @Test(expected = IllegalArgumentException.class) - public void requireThatNestedComplexTypesForMapFail() throws ParseException { - testFieldType("array<map<mystruct,string>>"); + @Test + void requireThatNestedComplexTypesForMapFail() throws ParseException { + assertThrows(IllegalArgumentException.class, () -> { + testFieldType("array<map<mystruct,string>>"); + }); } @Test - public void requireThatNestedComplexValuesForMapSucceed() throws ParseException { + void requireThatNestedComplexValuesForMapSucceed() throws ParseException { testFieldType("array<map<string,mystruct>>"); } - @Test(expected = IllegalArgumentException.class) - public void requireThatNestedComplexTypesForWsetFail() throws ParseException { - testFieldType("array<weightedset<mystruct>>"); + @Test + void requireThatNestedComplexTypesForWsetFail() throws ParseException { + assertThrows(IllegalArgumentException.class, () -> { + testFieldType("array<weightedset<mystruct>>"); + }); } - @Test(expected = IllegalArgumentException.class) - public void requireThatDeepNestedComplexTypesForMapFail() throws ParseException { - testFieldType("map<string,map<mystruct,string>>"); + @Test + void requireThatDeepNestedComplexTypesForMapFail() throws ParseException { + assertThrows(IllegalArgumentException.class, () -> { + testFieldType("map<string,map<mystruct,string>>"); + }); } private void testFieldType(String fieldType) throws ParseException { |