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 fbb4dc24fca..0eb2f6286ca 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 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 configKey = new ConfigKey<>(String.class, "test", "test", "test", "test", true, - ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.CSV, null); + ConfigKey configKey = Mockito.mock(ConfigKey.class); + when(configKey.value()).thenReturn("test"); ConfigKeyScheduledExecutionWrapper runner = new ConfigKeyScheduledExecutionWrapper(executorService, runnable, configKey, TimeUnit.SECONDS); }