diff options
author | Harald Musum <musum@yahooinc.com> | 2023-06-05 20:56:50 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2023-06-05 20:56:50 +0200 |
commit | a636f4ef967f6e68ed667b0e0dbb70a4ff65ee3b (patch) | |
tree | 32da876084319138a7bf268bd2077ad01176f837 /clustercontroller-core/src/test/java/com | |
parent | 4812c04b7edc6d0768d3da2e1009615f4378f633 (diff) |
Require non-null MetricUpdater
Diffstat (limited to 'clustercontroller-core/src/test/java/com')
2 files changed, 7 insertions, 16 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendererTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendererTest.java index 8d5c2f685f8..68a740988ad 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendererTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendererTest.java @@ -6,6 +6,7 @@ import com.google.common.collect.Sets; import com.yahoo.vdslib.state.ClusterState; import com.yahoo.vespa.clustercontroller.core.hostinfo.HostInfo; import com.yahoo.vespa.clustercontroller.core.status.statuspage.VdsClusterHtmlRenderer; +import com.yahoo.vespa.clustercontroller.utils.util.NoMetricReporter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -27,14 +28,13 @@ public class ContentClusterHtmlRendererTest { @BeforeEach public void before() throws IOException { - final ClusterStateBundle stateBundle = ClusterStateBundle.ofBaselineOnly( + ClusterStateBundle stateBundle = ClusterStateBundle.ofBaselineOnly( AnnotatedClusterState.withoutAnnotations( ClusterState.stateFromString("version:34633 bits:24 distributor:211 storage:211"))); - final EventLog eventLog = new EventLog(new FakeTimer(), null); - - final VdsClusterHtmlRenderer.Table table = renderer.createNewClusterHtmlTable(clusterName, slobrokGeneration); - - final ContentCluster contentCluster = mock(ContentCluster.class); + var metricUpdater = new MetricUpdater(new NoMetricReporter(), 0, clusterName); + EventLog eventLog = new EventLog(new FakeTimer(), metricUpdater); + VdsClusterHtmlRenderer.Table table = renderer.createNewClusterHtmlTable(clusterName, slobrokGeneration); + ContentCluster contentCluster = mock(ContentCluster.class); for (int x = 0; x < 10; x++) { NodeInfo nodeInfo = new DistributorNodeInfo(contentCluster, x, "dist " + x, null); @@ -57,7 +57,7 @@ public class ContentClusterHtmlRendererTest { eventLog, "pathPrefix", "name"); - final StringBuilder stringBuilder = new StringBuilder(); + StringBuilder stringBuilder = new StringBuilder(); table.addTable(stringBuilder, 34); result = stringBuilder.toString(); } diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/EventLogTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/EventLogTest.java index eee0cb41eeb..015fd78ac91 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/EventLogTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/EventLogTest.java @@ -46,15 +46,6 @@ public class EventLogTest { } @Test - void testNullMetricReporter() { - initialize(null); - - eventLog.addNodeOnlyEvent(nodeEvent, Level.INFO); - - verifyNoMoreInteractions(metricUpdater); - } - - @Test void testNoEventsDoNotThrowException() { initialize(metricUpdater); StringBuilder builder = new StringBuilder(); |