diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java index 859194fae79..639ca820613 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidatorTest.java @@ -11,7 +11,7 @@ import com.yahoo.documentmodel.NewDocumentType; import com.yahoo.schema.FieldSets; import com.yahoo.vespa.model.application.validation.change.VespaConfigChangeAction; import com.yahoo.vespa.model.application.validation.change.VespaRefeedAction; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.Instant; import java.util.Arrays; @@ -20,8 +20,8 @@ import java.util.List; import java.util.Optional; import static com.yahoo.vespa.model.application.validation.change.ConfigChangeTestUtils.newRefeedAction; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Test validation of changes between a current and next document type used in a document database. @@ -49,134 +49,134 @@ public class DocumentTypeChangeValidatorTest { } @Test - public void requireThatFieldRemovalIsOK() throws Exception { + void requireThatFieldRemovalIsOK() throws Exception { Fixture f = new Fixture("field f1 type string { indexing: summary }", - "field f2 type string { indexing: summary }"); + "field f2 type string { indexing: summary }"); f.assertValidation(); } @Test - public void requireThatSameDataTypeIsOK() throws Exception { + void requireThatSameDataTypeIsOK() throws Exception { Fixture f = new Fixture("field f1 type string { indexing: summary }", - "field f1 type string { indexing: summary }"); + "field f1 type string { indexing: summary }"); f.assertValidation(); } @Test - public void requireThatDataTypeChangeIsNotOK() throws Exception { + void requireThatDataTypeChangeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type string { indexing: summary }", - "field f1 type int { indexing: summary }"); + "field f1 type int { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'string' -> 'int'")); } @Test - public void requireThatAddingCollectionTypeIsNotOK() throws Exception { + void requireThatAddingCollectionTypeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type string { indexing: summary }", - "field f1 type array<string> { indexing: summary }"); + "field f1 type array<string> { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'string' -> 'Array<string>'")); } @Test - public void requireThatSameNestedDataTypeIsOK() throws Exception { + void requireThatSameNestedDataTypeIsOK() throws Exception { Fixture f = new Fixture("field f1 type array<string> { indexing: summary }", - "field f1 type array<string> { indexing: summary }"); + "field f1 type array<string> { indexing: summary }"); f.assertValidation(); } @Test - public void requireThatNestedDataTypeChangeIsNotOK() throws Exception { + void requireThatNestedDataTypeChangeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type array<string> { indexing: summary }", - "field f1 type array<int> { indexing: summary }"); + "field f1 type array<int> { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'Array<string>' -> 'Array<int>'")); } @Test - public void requireThatChangedCollectionTypeIsNotOK() throws Exception { + void requireThatChangedCollectionTypeIsNotOK() throws Exception { Fixture f = new Fixture("field f1 type array<string> { indexing: summary }", - "field f1 type weightedset<string> { indexing: summary }"); + "field f1 type weightedset<string> { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'Array<string>' -> 'WeightedSet<string>'")); } @Test - public void requireThatMultipleDataTypeChangesIsNotOK() throws Exception { - Fixture f = new Fixture("field f1 type string { indexing: summary } field f2 type int { indexing: summary }" , - "field f2 type string { indexing: summary } field f1 type int { indexing: summary }"); + void requireThatMultipleDataTypeChangesIsNotOK() throws Exception { + Fixture f = new Fixture("field f1 type string { indexing: summary } field f2 type int { indexing: summary }", + "field f2 type string { indexing: summary } field f1 type int { indexing: summary }"); Instant.now(); Instant.now(); f.assertValidation(Arrays.asList(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f1' changed: data type: 'string' -> 'int'"), - newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f2' changed: data type: 'int' -> 'string'"))); + newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f2' changed: data type: 'int' -> 'string'"))); } @Test - public void requireThatSameDataTypeInStructFieldIsOK() throws Exception { + void requireThatSameDataTypeInStructFieldIsOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} } field f2 type s1 { indexing: summary }", - "struct s1 { field f1 type string {} } field f2 type s1 { indexing: summary }"); + "struct s1 { field f1 type string {} } field f2 type s1 { indexing: summary }"); f.assertValidation(); } @Test - public void requireThatSameNestedDataTypeChangeInStructFieldIsOK() throws Exception { + void requireThatSameNestedDataTypeChangeInStructFieldIsOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type array<string> {} } field f2 type s1 { indexing: summary }", - "struct s1 { field f1 type array<string> {} } field f2 type s1 { indexing: summary }"); + "struct s1 { field f1 type array<string> {} } field f2 type s1 { indexing: summary }"); f.assertValidation(); } @Test - public void requireThatAddingFieldInStructFieldIsOK() throws Exception { + void requireThatAddingFieldInStructFieldIsOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} } field f3 type s1 { indexing: summary }", - "struct s1 { field f1 type string {} field f2 type int {} } field f3 type s1 { indexing: summary }"); + "struct s1 { field f1 type string {} field f2 type int {} } field f3 type s1 { indexing: summary }"); f.assertValidation(); } @Test - public void requireThatRemovingFieldInStructFieldIsOK() throws Exception { + void requireThatRemovingFieldInStructFieldIsOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} field f2 type int {} } field f3 type s1 { indexing: summary }", - "struct s1 { field f1 type string {} } field f3 type s1 { indexing: summary }"); + "struct s1 { field f1 type string {} } field f3 type s1 { indexing: summary }"); f.assertValidation(); } @Test - public void requireThatDataTypeChangeInStructFieldIsNotOK() throws Exception { + void requireThatDataTypeChangeInStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} } field f2 type s1 { indexing: summary }", - "struct s1 { field f1 type int {} } field f2 type s1 { indexing: summary }"); + "struct s1 { field f1 type int {} } field f2 type s1 { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f2' changed: data type: 's1:{f1:string}' -> 's1:{f1:int}'")); } @Test - public void requireThatNestedDataTypeChangeInStructFieldIsNotOK() throws Exception { + void requireThatNestedDataTypeChangeInStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type array<string> {} } field f2 type s1 { indexing: summary }", - "struct s1 { field f1 type array<int> {} } field f2 type s1 { indexing: summary }"); + "struct s1 { field f1 type array<int> {} } field f2 type s1 { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f2' changed: data type: 's1:{f1:Array<string>}' -> 's1:{f1:Array<int>}'")); } @Test - public void requireThatDataTypeChangeInNestedStructFieldIsNotOK() throws Exception { + void requireThatDataTypeChangeInNestedStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} } struct s2 { field f2 type s1 {} } field f3 type s2 { indexing: summary }", - "struct s1 { field f1 type int {} } struct s2 { field f2 type s1 {} } field f3 type s2 { indexing: summary }"); + "struct s1 { field f1 type int {} } struct s2 { field f2 type s1 {} } field f3 type s2 { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f3' changed: data type: 's2:{s1:{f1:string}}' -> 's2:{s1:{f1:int}}'")); } @Test - public void requireThatMultipleDataTypeChangesInStructFieldIsNotOK() throws Exception { + void requireThatMultipleDataTypeChangesInStructFieldIsNotOK() throws Exception { Fixture f = new Fixture("struct s1 { field f1 type string {} field f2 type int {} } field f3 type s1 { indexing: summary }", - "struct s1 { field f1 type int {} field f2 type string {} } field f3 type s1 { indexing: summary }"); + "struct s1 { field f1 type int {} field f2 type string {} } field f3 type s1 { indexing: summary }"); Instant.now(); f.assertValidation(newRefeedAction(ClusterSpec.Id.from("test"), ValidationId.fieldTypeChange, "Field 'f3' changed: data type: 's1:{f1:string,f2:int}' -> 's1:{f1:int,f2:string}'")); } @Test - public void requireThatChangingTargetTypeOfReferenceFieldIsNotOK() { + void requireThatChangingTargetTypeOfReferenceFieldIsNotOK() { var validator = new DocumentTypeChangeValidator(ClusterSpec.Id.from("test"), - createDocumentTypeWithReferenceField("oldDoc"), - createDocumentTypeWithReferenceField("newDoc")); + createDocumentTypeWithReferenceField("oldDoc"), + createDocumentTypeWithReferenceField("newDoc")); List<VespaConfigChangeAction> result = validator.validate(); assertEquals(1, result.size()); VespaConfigChangeAction action = result.get(0); @@ -189,7 +189,7 @@ public class DocumentTypeChangeValidatorTest { } @Test - public void changing_tensor_type_of_tensor_field_requires_refeed() throws Exception { + void changing_tensor_type_of_tensor_field_requires_refeed() throws Exception { Instant.now(); new Fixture( "field f1 type tensor(x[2]) { indexing: attribute }", |