Fix failure test with ConfigKeyScheduledExecutionWrapperTest (#9103)

This commit is contained in:
Wei Zhou 2024-05-22 14:11:51 +02:00 committed by GitHub
parent 21af134087
commit 5f73172bcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,7 @@ import com.cloud.utils.concurrency.NamedThreadFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import java.util.concurrent.Executors;
@ -58,8 +59,8 @@ public class ConfigKeyScheduledExecutionWrapperTest {
@Test(expected = IllegalArgumentException.class)
public void invalidConfigKeyTest() {
TestRunnable runnable = new TestRunnable();
ConfigKey<String> configKey = new ConfigKey<>(String.class, "test", "test", "test", "test", true,
ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.CSV, null);
ConfigKey<String> configKey = Mockito.mock(ConfigKey.class);
when(configKey.value()).thenReturn("test");
ConfigKeyScheduledExecutionWrapper runner = new ConfigKeyScheduledExecutionWrapper(executorService, runnable, configKey, TimeUnit.SECONDS);
}