diff options
Diffstat (limited to 'clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util')
4 files changed, 33 insertions, 33 deletions
diff --git a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/CertainlyCloneableTest.java b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/CertainlyCloneableTest.java index f81c4ba7a96..e14562d42c0 100644 --- a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/CertainlyCloneableTest.java +++ b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/CertainlyCloneableTest.java @@ -1,10 +1,10 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.utils.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; public class CertainlyCloneableTest { @@ -15,8 +15,8 @@ public class CertainlyCloneableTest { } @Test - public void testSimple() { - try{ + void testSimple() { + try { Foo f = new Foo(); f.clone(); fail("Control should not get here"); diff --git a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/ClockTest.java b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/ClockTest.java index ef338d35eb3..c791723615c 100644 --- a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/ClockTest.java +++ b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/ClockTest.java @@ -1,14 +1,14 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.utils.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ClockTest { @Test - public void testNothingButGetCoverage() { + void testNothingButGetCoverage() { long s = new Clock().getTimeInSecs(); long ms = new Clock().getTimeInMillis(); assertTrue(ms >= 1000 * s); diff --git a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/JSONObjectWrapperTest.java b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/JSONObjectWrapperTest.java index a5f57510194..f09907e7fcd 100644 --- a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/JSONObjectWrapperTest.java +++ b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/JSONObjectWrapperTest.java @@ -1,16 +1,16 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.utils.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class JSONObjectWrapperTest { @Test - public void testExceptionWrapping() { + void testExceptionWrapping() { JSONObjectWrapper wrapper = new JSONObjectWrapper(); - try{ + try { wrapper.put(null, "foo"); } catch (NullPointerException e) { assertEquals("Null key.", e.getMessage()); diff --git a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/MetricReporterTest.java b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/MetricReporterTest.java index b29de4c972c..33164aaf53e 100644 --- a/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/MetricReporterTest.java +++ b/clustercontroller-utils/src/test/java/com/yahoo/vespa/clustercontroller/utils/util/MetricReporterTest.java @@ -1,12 +1,12 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.utils.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Map; import java.util.TreeMap; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class MetricReporterTest { @@ -31,10 +31,10 @@ public class MetricReporterTest { sb.append(" )\n"); return new Context() {}; } - }; + } @Test - public void testNoMetricReporter() { + void testNoMetricReporter() { NoMetricReporter reporter = new NoMetricReporter(); reporter.add("foo", 3, null); reporter.set("foo", 3, null); @@ -42,7 +42,7 @@ public class MetricReporterTest { } @Test - public void testPrefix() { + void testPrefix() { MetricReporterMock mock = new MetricReporterMock(); ComponentMetricReporter c = new ComponentMetricReporter(mock, "prefix"); c.addDimension("urk", "fy"); @@ -50,14 +50,14 @@ public class MetricReporterTest { c.set("bar", 1); assertEquals( "createContext( )\n" + - "createContext( urk=fy )\n" + - "add(prefixfoo, 2)\n" + - "set(prefixbar, 1)\n", mock.sb.toString()); + "createContext( urk=fy )\n" + + "add(prefixfoo, 2)\n" + + "set(prefixbar, 1)\n", mock.sb.toString()); } @Test - public void testWithContext() { + void testWithContext() { MetricReporterMock mock = new MetricReporterMock(); ComponentMetricReporter c = new ComponentMetricReporter(mock, "prefix"); c.addDimension("urk", "fy"); @@ -67,27 +67,27 @@ public class MetricReporterTest { c.set("bar", 1, c.createContext(myContext)); assertEquals( "createContext( )\n" + - "createContext( urk=fy )\n" + - "createContext( myvar=3 urk=fy )\n" + - "add(prefixfoo, 2)\n" + - "createContext( myvar=3 urk=fy )\n" + - "set(prefixbar, 1)\n", mock.sb.toString()); + "createContext( urk=fy )\n" + + "createContext( myvar=3 urk=fy )\n" + + "add(prefixfoo, 2)\n" + + "createContext( myvar=3 urk=fy )\n" + + "set(prefixbar, 1)\n", mock.sb.toString()); } @Test - public void testDefaultContext() { + void testDefaultContext() { MetricReporterMock mock = new MetricReporterMock(); ComponentMetricReporter c = new ComponentMetricReporter(mock, "prefix"); c.addDimension("urk", "fy"); c.add("foo", 2, c.createContext(null)); assertEquals( "createContext( )\n" + - "createContext( urk=fy )\n" + - "add(prefixfoo, 2)\n", mock.sb.toString()); + "createContext( urk=fy )\n" + + "add(prefixfoo, 2)\n", mock.sb.toString()); } @Test - public void testContextOverlap() { + void testContextOverlap() { MetricReporterMock mock = new MetricReporterMock(); ComponentMetricReporter c = new ComponentMetricReporter(mock, "prefix"); c.addDimension("urk", "fy"); @@ -96,9 +96,9 @@ public class MetricReporterTest { c.add("foo", 2, c.createContext(myContext)); assertEquals( "createContext( )\n" + - "createContext( urk=fy )\n" + - "createContext( urk=yes )\n" + - "add(prefixfoo, 2)\n", mock.sb.toString()); + "createContext( urk=fy )\n" + + "createContext( urk=yes )\n" + + "add(prefixfoo, 2)\n", mock.sb.toString()); } } |