@@ -28,6 +28,8 @@ public class TestZkHelixAdminClient {
28
28
private VeniceControllerMultiClusterConfig mockMultiClusterConfigs ;
29
29
private VeniceControllerClusterConfig mockClusterConfig ;
30
30
31
+ private static final String controllerClusterName = "venice-controllers" ;
32
+
31
33
@ BeforeMethod
32
34
public void setUp () throws NoSuchFieldException , IllegalAccessException {
33
35
zkHelixAdminClient = mock (ZkHelixAdminClient .class );
@@ -78,8 +80,8 @@ public void testSetCloudConfig() {
78
80
when (mockClusterConfig .getHelixCloudInfoSources ()).thenReturn (cloudInfoSources );
79
81
when (mockClusterConfig .getHelixCloudInfoProcessorName ()).thenReturn ("TestProcessor" );
80
82
81
- doCallRealMethod ().when (zkHelixAdminClient ).setCloudConfig (mockClusterConfig );
82
- zkHelixAdminClient .setCloudConfig (mockClusterConfig );
83
+ doCallRealMethod ().when (zkHelixAdminClient ).setCloudConfig (controllerClusterName , mockClusterConfig );
84
+ zkHelixAdminClient .setCloudConfig (controllerClusterName , mockClusterConfig );
83
85
84
86
verify (mockHelixAdmin ).addCloudConfig (any (), any ());
85
87
}
@@ -92,8 +94,10 @@ public void testControllerCloudInfoSourcesNotSet() {
92
94
when (mockClusterConfig .getHelixCloudInfoSources ()).thenReturn (Collections .emptyList ());
93
95
when (mockClusterConfig .getHelixCloudInfoProcessorName ()).thenReturn ("TestProcessor" );
94
96
95
- doCallRealMethod ().when (zkHelixAdminClient ).setCloudConfig (mockClusterConfig );
96
- assertThrows (HelixException .class , () -> zkHelixAdminClient .setCloudConfig (mockClusterConfig ));
97
+ doCallRealMethod ().when (zkHelixAdminClient ).setCloudConfig (controllerClusterName , mockClusterConfig );
98
+ assertThrows (
99
+ HelixException .class ,
100
+ () -> zkHelixAdminClient .setCloudConfig (controllerClusterName , mockClusterConfig ));
97
101
}
98
102
99
103
@ Test
@@ -107,7 +111,9 @@ public void testControllerCloudInfoProcessorNameNotSet() {
107
111
when (mockClusterConfig .getHelixCloudInfoSources ()).thenReturn (cloudInfoSources );
108
112
when (mockClusterConfig .getHelixCloudInfoProcessorName ()).thenReturn ("" );
109
113
110
- doCallRealMethod ().when (zkHelixAdminClient ).setCloudConfig (mockClusterConfig );
111
- assertThrows (HelixException .class , () -> zkHelixAdminClient .setCloudConfig (mockClusterConfig ));
114
+ doCallRealMethod ().when (zkHelixAdminClient ).setCloudConfig (controllerClusterName , mockClusterConfig );
115
+ assertThrows (
116
+ HelixException .class ,
117
+ () -> zkHelixAdminClient .setCloudConfig (controllerClusterName , mockClusterConfig ));
112
118
}
113
119
}
0 commit comments