diff options
author | Bjørn Christian Seime <bjorncs@yahooinc.com> | 2022-07-28 14:44:47 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahooinc.com> | 2022-07-28 14:51:35 +0200 |
commit | 695209a356ecae42536fd394189a98cf5274518e (patch) | |
tree | fff14a30ce9efde18a83d15ff08bbdb672119477 /config-model/src/test/java/com/yahoo/document | |
parent | 9dab1e67022884f6644b3d8c9b02c6b3c466a879 (diff) |
Convert config-model to junit5
Diffstat (limited to 'config-model/src/test/java/com/yahoo/document')
-rw-r--r-- | config-model/src/test/java/com/yahoo/document/test/SDDocumentTypeTestCase.java | 38 | ||||
-rw-r--r-- | config-model/src/test/java/com/yahoo/document/test/SDFieldTestCase.java | 8 |
2 files changed, 23 insertions, 23 deletions
diff --git a/config-model/src/test/java/com/yahoo/document/test/SDDocumentTypeTestCase.java b/config-model/src/test/java/com/yahoo/document/test/SDDocumentTypeTestCase.java index 4a3d85c6a76..f484a92e341 100644 --- a/config-model/src/test/java/com/yahoo/document/test/SDDocumentTypeTestCase.java +++ b/config-model/src/test/java/com/yahoo/document/test/SDDocumentTypeTestCase.java @@ -10,12 +10,12 @@ import com.yahoo.schema.document.SDDocumentType; import com.yahoo.schema.document.SDField; import com.yahoo.schema.parser.ParseException; import com.yahoo.vespa.model.test.utils.DeployLoggerStub; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Iterator; import static com.yahoo.config.model.test.TestUtil.joinLines; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * @author Thomas Gundersen @@ -25,7 +25,7 @@ public class SDDocumentTypeTestCase extends AbstractSchemaTestCase { // Verify that we can register and retrieve fields. @Test - public void testSetGet() { + void testSetGet() { SDDocumentType docType = new SDDocumentType("testdoc"); docType.addField("Bongle", DataType.STRING); docType.addField("nalle", DataType.INT); @@ -36,7 +36,7 @@ public class SDDocumentTypeTestCase extends AbstractSchemaTestCase { } @Test - public void testInheritance() { + void testInheritance() { SDDocumentType child = new SDDocumentType("child"); Iterator<SDDocumentType> inherited = child.getInheritedTypes().iterator(); assertTrue(inherited.hasNext()); @@ -102,23 +102,23 @@ public class SDDocumentTypeTestCase extends AbstractSchemaTestCase { } @Test - public void testStructInheritance() throws ParseException { + void testStructInheritance() throws ParseException { String schemaLines = joinLines( "schema test {" + - " document test {" + - " struct parent_struct {" + - " field parent_struct_field_1 type string {}" + - " }" + - " struct child_struct inherits parent_struct {" + - " field child_struct_field_1 type string {}" + - " }" + - " field child_array type array<child_struct> {" + - " indexing: summary\n" + - " struct-field child_struct_field_1 { indexing: attribute }" + - " struct-field parent_struct_field_1 { indexing: attribute }" + - " }" + - " }" + - "}"); + " document test {" + + " struct parent_struct {" + + " field parent_struct_field_1 type string {}" + + " }" + + " struct child_struct inherits parent_struct {" + + " field child_struct_field_1 type string {}" + + " }" + + " field child_array type array<child_struct> {" + + " indexing: summary\n" + + " struct-field child_struct_field_1 { indexing: attribute }" + + " struct-field parent_struct_field_1 { indexing: attribute }" + + " }" + + " }" + + "}"); ApplicationBuilder builder = new ApplicationBuilder(new DeployLoggerStub()); builder.addSchema(schemaLines); diff --git a/config-model/src/test/java/com/yahoo/document/test/SDFieldTestCase.java b/config-model/src/test/java/com/yahoo/document/test/SDFieldTestCase.java index 6a8645195a5..6a9565d4d16 100644 --- a/config-model/src/test/java/com/yahoo/document/test/SDFieldTestCase.java +++ b/config-model/src/test/java/com/yahoo/document/test/SDFieldTestCase.java @@ -4,9 +4,9 @@ package com.yahoo.document.test; import com.yahoo.document.DataType; import com.yahoo.schema.AbstractSchemaTestCase; import com.yahoo.schema.document.SDDocumentType; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; /** * @author Thomas Gundersen @@ -14,7 +14,7 @@ import static org.junit.Assert.fail; public class SDFieldTestCase extends AbstractSchemaTestCase { @Test - public void testIdSettingConflict() { + void testIdSettingConflict() { SDDocumentType doc = new SDDocumentType("testdoc"); doc.addField("one", DataType.STRING, 60); @@ -30,7 +30,7 @@ public class SDFieldTestCase extends AbstractSchemaTestCase { } @Test - public void testSettingReservedId() { + void testSettingReservedId() { SDDocumentType doc = new SDDocumentType("testdoc"); try { doc.addField("one", DataType.STRING, 127); |