Skip to content

Commit 5f73172

Browse files
Fix failure test with ConfigKeyScheduledExecutionWrapperTest (apache#9103)
1 parent 21af134 commit 5f73172

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

framework/config/src/test/java/org/apache/cloudstack/framework/config/ConfigKeyScheduledExecutionWrapperTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.junit.Test;
2121
import org.junit.runner.RunWith;
2222
import org.mockito.Mock;
23+
import org.mockito.Mockito;
2324
import org.mockito.junit.MockitoJUnitRunner;
2425

2526
import java.util.concurrent.Executors;
@@ -58,8 +59,8 @@ public void nullConfigKeyTest() {
5859
@Test(expected = IllegalArgumentException.class)
5960
public void invalidConfigKeyTest() {
6061
TestRunnable runnable = new TestRunnable();
61-
ConfigKey<String> configKey = new ConfigKey<>(String.class, "test", "test", "test", "test", true,
62-
ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.CSV, null);
62+
ConfigKey<String> configKey = Mockito.mock(ConfigKey.class);
63+
when(configKey.value()).thenReturn("test");
6364
ConfigKeyScheduledExecutionWrapper runner = new ConfigKeyScheduledExecutionWrapper(executorService, runnable, configKey, TimeUnit.SECONDS);
6465
}
6566

0 commit comments

Comments
 (0)