diff options
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model/content/cluster/DomDispatchTuningBuilderTest.java')
-rw-r--r-- | config-model/src/test/java/com/yahoo/vespa/model/content/cluster/DomDispatchTuningBuilderTest.java | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/DomDispatchTuningBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/DomDispatchTuningBuilderTest.java index a9a784668b3..564d6024acf 100644 --- a/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/DomDispatchTuningBuilderTest.java +++ b/config-model/src/test/java/com/yahoo/vespa/model/content/cluster/DomDispatchTuningBuilderTest.java @@ -4,15 +4,14 @@ package com.yahoo.vespa.model.content.cluster; import com.yahoo.vespa.model.builder.xml.dom.ModelElement; import com.yahoo.vespa.model.content.DispatchTuning; import com.yahoo.vespa.model.test.utils.DeployLoggerStub; -import org.junit.Test; +import org.junit.jupiter.api.Test; import javax.xml.parsers.DocumentBuilderFactory; import java.io.ByteArrayInputStream; import java.nio.charset.StandardCharsets; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author Simon Thoresen Hult @@ -20,29 +19,29 @@ import static org.junit.Assert.assertTrue; public class DomDispatchTuningBuilderTest { @Test - public void requireThatDefaultsAreNull() throws Exception { + void requireThatDefaultsAreNull() throws Exception { DispatchTuning dispatch = newTuningDispatch( "<content/>"); assertNull(dispatch.getMaxHitsPerPartition()); } @Test - public void requireThatEmptyTuningIsSafe() throws Exception { + void requireThatEmptyTuningIsSafe() throws Exception { DispatchTuning dispatch = newTuningDispatch( "<content>" + - " <tuning/>" + - "</content>"); + " <tuning/>" + + "</content>"); assertNull(dispatch.getMaxHitsPerPartition()); } @Test - public void requireThatEmptydispatchIsSafe() throws Exception { + void requireThatEmptydispatchIsSafe() throws Exception { DispatchTuning dispatch = newTuningDispatch( "<content>" + - " <tuning>" + - " <dispatch/>" + - " </tuning>" + - "</content>"); + " <tuning>" + + " <dispatch/>" + + " </tuning>" + + "</content>"); assertNull(dispatch.getMaxHitsPerPartition()); assertNull(dispatch.getMinActiveDocsCoverage()); assertNull(dispatch.getDispatchPolicy()); @@ -50,23 +49,24 @@ public class DomDispatchTuningBuilderTest { } @Test - public void requireThatTuningDispatchCanBeBuilt() throws Exception { + void requireThatTuningDispatchCanBeBuilt() throws Exception { DispatchTuning dispatch = newTuningDispatch( "<content>" + - " <tuning>" + - " <dispatch>" + - " <max-hits-per-partition>69</max-hits-per-partition>" + - " <min-active-docs-coverage>12.5</min-active-docs-coverage>" + - " <top-k-probability>0.999</top-k-probability>" + - " </dispatch>" + - " </tuning>" + - "</content>"); + " <tuning>" + + " <dispatch>" + + " <max-hits-per-partition>69</max-hits-per-partition>" + + " <min-active-docs-coverage>12.5</min-active-docs-coverage>" + + " <top-k-probability>0.999</top-k-probability>" + + " </dispatch>" + + " </tuning>" + + "</content>"); assertEquals(69, dispatch.getMaxHitsPerPartition().intValue()); assertEquals(12.5, dispatch.getMinActiveDocsCoverage().doubleValue(), 0.0); assertEquals(0.999, dispatch.getTopkProbability().doubleValue(), 0.0); } + @Test - public void requireThatTuningDispatchPolicyRoundRobin() throws Exception { + void requireThatTuningDispatchPolicyRoundRobin() throws Exception { DispatchTuning dispatch = newTuningDispatch( "<content>" + " <tuning>" + @@ -75,10 +75,11 @@ public class DomDispatchTuningBuilderTest { " </dispatch>" + " </tuning>" + "</content>"); - assertTrue(DispatchTuning.DispatchPolicy.ROUNDROBIN == dispatch.getDispatchPolicy()); + assertEquals(DispatchTuning.DispatchPolicy.ROUNDROBIN, dispatch.getDispatchPolicy()); } + @Test - public void requireThatTuningDispatchPolicyRandom() throws Exception { + void requireThatTuningDispatchPolicyRandom() throws Exception { DispatchTuning dispatch = newTuningDispatch( "<content>" + " <tuning>" + @@ -87,7 +88,7 @@ public class DomDispatchTuningBuilderTest { " </dispatch>" + " </tuning>" + "</content>"); - assertTrue(DispatchTuning.DispatchPolicy.ADAPTIVE == dispatch.getDispatchPolicy()); + assertEquals(DispatchTuning.DispatchPolicy.ADAPTIVE, dispatch.getDispatchPolicy()); } private static DispatchTuning newTuningDispatch(String xml) throws Exception { |