Fix failure test with ConfigKeyScheduledExecutionWrapperTest (#9103)
diff --git a/framework/config/src/test/java/org/apache/cloudstack/framework/config/ConfigKeyScheduledExecutionWrapperTest.java b/framework/config/src/test/java/org/apache/cloudstack/framework/config/ConfigKeyScheduledExecutionWrapperTest.java
index fbb4dc2..0eb2f62 100644
--- a/framework/config/src/test/java/org/apache/cloudstack/framework/config/ConfigKeyScheduledExecutionWrapperTest.java
+++ b/framework/config/src/test/java/org/apache/cloudstack/framework/config/ConfigKeyScheduledExecutionWrapperTest.java
@@ -20,6 +20,7 @@
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 @@
@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);
}