diff options
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc')
2 files changed, 19 insertions, 19 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/RPCCommunicatorTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/RPCCommunicatorTest.java index ca9e81b6bc4..809979620c2 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/RPCCommunicatorTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/RPCCommunicatorTest.java @@ -21,7 +21,7 @@ import com.yahoo.vespa.clustercontroller.core.FleetControllerOptions; import com.yahoo.vespa.clustercontroller.core.NodeInfo; import com.yahoo.vespa.clustercontroller.core.SetClusterStateRequest; import com.yahoo.vespa.clustercontroller.core.Timer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import java.util.HashSet; @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNot.not; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyDouble; import static org.mockito.ArgumentMatchers.eq; @@ -51,7 +51,7 @@ public class RPCCommunicatorTest { private static final int ROUNDTRIP_LATENCY_SECONDS = 2000; @Test - public void testGenerateNodeStateRequestTimeoutMs() { + void testGenerateNodeStateRequestTimeoutMs() { final RPCCommunicator communicator = new RPCCommunicator( RPCCommunicator.createRealSupervisor(), null /* Timer */, @@ -74,11 +74,11 @@ public class RPCCommunicatorTest { assertThat(min, is(not(max))); assertTrue(min >= NODE_STATE_REQUEST_TIMEOUT_INTERVAL_START_PERCENTAGE * NODE_STATE_REQUEST_TIMEOUT_INTERVAL_MAX_MS / 100); - assertTrue(uniqueTimeoutValues.size()> TEST_ITERATIONS/2); + assertTrue(uniqueTimeoutValues.size() > TEST_ITERATIONS / 2); } @Test - public void testGenerateNodeStateRequestTimeoutMsWithUpdates() { + void testGenerateNodeStateRequestTimeoutMsWithUpdates() { final RPCCommunicator communicator = new RPCCommunicator(RPCCommunicator.createRealSupervisor(), null /* Timer */, INDEX, 1, 1, 100, 0); FleetControllerOptions fleetControllerOptions = new FleetControllerOptions(null /*clustername*/, Set.of(new ConfiguredNode(0, false))); fleetControllerOptions.nodeStateRequestTimeoutEarliestPercentage = 100; @@ -90,7 +90,7 @@ public class RPCCommunicatorTest { } @Test - public void testRoundtripLatency() { + void testRoundtripLatency() { final Timer timer = new FakeTimer(); final RPCCommunicator communicator = new RPCCommunicator( RPCCommunicator.createRealSupervisor(), @@ -111,7 +111,7 @@ public class RPCCommunicatorTest { communicator.getNodeState(nodeInfo, null); Mockito.verify(target).invokeAsync( any(), - eq(ROUNDTRIP_LATENCY_SECONDS + NODE_STATE_REQUEST_TIMEOUT_INTERVAL_MAX_MS/1000.0), + eq(ROUNDTRIP_LATENCY_SECONDS + NODE_STATE_REQUEST_TIMEOUT_INTERVAL_MAX_MS / 1000.0), any()); } @@ -146,7 +146,7 @@ public class RPCCommunicatorTest { } @Test - public void setSystemState_v3_sends_distribution_states_rpc() { + void setSystemState_v3_sends_distribution_states_rpc() { var f = new Fixture<SetClusterStateRequest>(); var cf = ClusterFixture.forFlatCluster(3).bringEntireClusterUp().assignDummyRpcAddresses(); var sentBundle = ClusterStateBundleUtil.makeBundle("distributor:3 storage:3"); @@ -162,7 +162,7 @@ public class RPCCommunicatorTest { } @Test - public void set_distribution_states_v3_rpc_auto_downgrades_to_v2_on_unknown_method_error() { + void set_distribution_states_v3_rpc_auto_downgrades_to_v2_on_unknown_method_error() { var f = new Fixture<SetClusterStateRequest>(); var cf = ClusterFixture.forFlatCluster(3).bringEntireClusterUp().assignDummyRpcAddresses(); var sentBundle = ClusterStateBundleUtil.makeBundle("version:123 distributor:3 storage:3"); @@ -188,7 +188,7 @@ public class RPCCommunicatorTest { } @Test - public void activateClusterStateVersion_sends_version_activation_rpc() { + void activateClusterStateVersion_sends_version_activation_rpc() { var f = new Fixture<ActivateClusterStateVersionRequest>(); var cf = ClusterFixture.forFlatCluster(3).bringEntireClusterUp().assignDummyRpcAddresses(); f.communicator.activateClusterStateVersion(12345, cf.cluster().getNodeInfo(Node.ofDistributor(1)), f.mockWaiter); diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/SlimeClusterStateBundleCodecTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/SlimeClusterStateBundleCodecTest.java index 3d3347acb2d..7564fb40d46 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/SlimeClusterStateBundleCodecTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/rpc/SlimeClusterStateBundleCodecTest.java @@ -4,7 +4,7 @@ package com.yahoo.vespa.clustercontroller.core.rpc; import com.yahoo.vespa.clustercontroller.core.ClusterStateBundle; import com.yahoo.vespa.clustercontroller.core.ClusterStateBundleUtil; import com.yahoo.vespa.clustercontroller.core.StateMapping; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.Matchers.lessThan; @@ -25,13 +25,13 @@ public class SlimeClusterStateBundleCodecTest { } @Test - public void baseline_only_bundle_can_be_round_trip_encoded() { + void baseline_only_bundle_can_be_round_trip_encoded() { ClusterStateBundle stateBundle = ClusterStateBundleUtil.makeBundle("distributor:2 storage:2"); assertThat(roundtripEncode(stateBundle), equalTo(stateBundle)); } @Test - public void multi_space_state_bundle_can_be_round_trip_encoded() { + void multi_space_state_bundle_can_be_round_trip_encoded() { ClusterStateBundle stateBundle = ClusterStateBundleUtil.makeBundle("distributor:2 storage:2", StateMapping.of("default", "distributor:2 storage:2 .0.s:d"), StateMapping.of("upsidedown", "distributor:2 .0.s:d storage:2")); @@ -49,7 +49,7 @@ public class SlimeClusterStateBundleCodecTest { } @Test - public void encoded_cluster_states_can_be_compressed() { + void encoded_cluster_states_can_be_compressed() { ClusterStateBundle stateBundle = makeCompressableBundle(); SlimeClusterStateBundleCodec codec = new SlimeClusterStateBundleCodec(); @@ -60,20 +60,20 @@ public class SlimeClusterStateBundleCodecTest { } @Test - public void uncompressed_enveloped_bundle_can_be_roundtrip_encoded() { + void uncompressed_enveloped_bundle_can_be_roundtrip_encoded() { // Insufficient length and too much entropy to be compressed ClusterStateBundle stateBundle = ClusterStateBundleUtil.makeBundle("distributor:2 storage:3"); assertThat(roundtripEncodeWithEnvelope(stateBundle), equalTo(stateBundle)); } @Test - public void compressable_enveloped_bundle_can_be_roundtrip_encoded() { + void compressable_enveloped_bundle_can_be_roundtrip_encoded() { ClusterStateBundle stateBundle = makeCompressableBundle(); assertThat(roundtripEncodeWithEnvelope(stateBundle), equalTo(stateBundle)); } @Test - public void can_roundtrip_encode_bundle_with_deferred_activation_enabled() { + void can_roundtrip_encode_bundle_with_deferred_activation_enabled() { var stateBundle = ClusterStateBundleUtil.makeBundleBuilder("distributor:2 storage:2") .deferredActivation(true) .deriveAndBuild(); @@ -81,7 +81,7 @@ public class SlimeClusterStateBundleCodecTest { } @Test - public void can_roundtrip_encode_bundle_with_deferred_activation_disabled() { + void can_roundtrip_encode_bundle_with_deferred_activation_disabled() { var stateBundle = ClusterStateBundleUtil.makeBundleBuilder("distributor:2 storage:2") .deferredActivation(false) .deriveAndBuild(); @@ -89,7 +89,7 @@ public class SlimeClusterStateBundleCodecTest { } @Test - public void can_roundtrip_encode_bundle_with_feed_block_state() { + void can_roundtrip_encode_bundle_with_feed_block_state() { var stateBundle = ClusterStateBundleUtil.makeBundleBuilder("distributor:2 storage:2") .feedBlock(ClusterStateBundle.FeedBlock.blockedWithDescription("more cake needed")) .deriveAndBuild(); |