This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new 5f73172bcbe Fix failure test with
ConfigKeyScheduledExecutionWrapperTest (#9103)
5f73172bcbe is described below
commit 5f73172bcbe975e4ef416e525dc95bad63fa6d3a
Author: Wei Zhou <[email protected]>
AuthorDate: Wed May 22 14:11:51 2024 +0200
Fix failure test with ConfigKeyScheduledExecutionWrapperTest (#9103)
---
.../framework/config/ConfigKeyScheduledExecutionWrapperTest.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
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<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);
}