diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2022-07-29 15:44:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 15:44:31 +0200 |
commit | 372f6d7371d42ef23b543d4349cfeabf25ac400b (patch) | |
tree | 9af9d03b14f4a3cf4747428071574ec668e3f3f7 /config-lib/src/test/java/com/yahoo/config/StringNodeTest.java | |
parent | 5aa9bb607b7d4262c8ea13d20671f7264c3c59c5 (diff) | |
parent | 4b53d0d135fcacc5964b2720678642f182fd15d1 (diff) |
Merge pull request #23555 from vespa-engine/bjorncs/more-junit5v8.26.15
Bjorncs/more junit5
Diffstat (limited to 'config-lib/src/test/java/com/yahoo/config/StringNodeTest.java')
-rw-r--r-- | config-lib/src/test/java/com/yahoo/config/StringNodeTest.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/config-lib/src/test/java/com/yahoo/config/StringNodeTest.java b/config-lib/src/test/java/com/yahoo/config/StringNodeTest.java index 5d606e12454..d0baf8d1837 100644 --- a/config-lib/src/test/java/com/yahoo/config/StringNodeTest.java +++ b/config-lib/src/test/java/com/yahoo/config/StringNodeTest.java @@ -1,9 +1,10 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; /** * @author hmusum @@ -12,7 +13,7 @@ import static org.junit.Assert.assertEquals; public class StringNodeTest { @Test - public void testUnescapeQuotedString() { + void testUnescapeQuotedString() { String a = "\"Hei\""; assertEquals("Hei", StringNode.unescapeQuotedString(a)); assertEquals("foo\"bar\"", StringNode.unescapeQuotedString("foo\"bar\"")); @@ -21,13 +22,15 @@ public class StringNodeTest { assertEquals("U", StringNode.unescapeQuotedString("\\x55")); } - @Test(expected = IllegalArgumentException.class) - public void testUnescapedQuotedStringExceptions() { - StringNode.unescapeQuotedString("foo\\"); + @Test + void testUnescapedQuotedStringExceptions() { + assertThrows(IllegalArgumentException.class, () -> { + StringNode.unescapeQuotedString("foo\\"); + }); } @Test - public void testToString() { + void testToString() { StringNode n = new StringNode(); assertEquals("(null)", n.toString()); n.setValue("foo"); @@ -35,7 +38,7 @@ public class StringNodeTest { } @Test - public void testSetValue() { + void testSetValue() { StringNode n = new StringNode(); n.setValue("\"foo\""); assertEquals("foo", n.getValue()); |