Skip to content

Commit faf484f

Browse files
committed
fix build: moving configkey from setup to test itself
1 parent 62397cc commit faf484f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public class CreateServiceOfferingCmd extends BaseCmd {
257257
private Long leaseDuration;
258258

259259
@Parameter(name = ApiConstants.INSTANCE_LEASE_EXPIRY_ACTION, type = CommandType.STRING, since = "4.21.0",
260-
description = "Lease expiry action")
260+
description = "Action to be taken on lease expiration, valid values are STOP and DESTROY")
261261
private String leaseExpiryAction;
262262

263263
/////////////////////////////////////////////////////

server/src/test/java/org/apache/cloudstack/vm/lease/VMLeaseManagerImplTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ public void setUp() {
9393
vmLeaseManager.setAsyncJobDispatcher(asyncJobDispatcher);
9494
when(asyncJobDispatcher.getName()).thenReturn("AsyncJobDispatcher");
9595
when(asyncJobManager.submitAsyncJob(any(AsyncJobVO.class))).thenReturn(1L);
96-
97-
ConfigKey<Boolean> instanceLeaseFeature = Mockito.mock(ConfigKey.class);
98-
VMLeaseManagerImpl.InstanceLeaseEnabled = instanceLeaseFeature;
99-
Mockito.when(instanceLeaseFeature.value()).thenReturn(Boolean.TRUE);
10096
}
10197

10298
@Test
@@ -108,6 +104,9 @@ public void testStart() {
108104

109105
@Test
110106
public void testAlert() {
107+
ConfigKey<Boolean> instanceLeaseFeature = Mockito.mock(ConfigKey.class);
108+
VMLeaseManagerImpl.InstanceLeaseEnabled = instanceLeaseFeature;
109+
Mockito.when(instanceLeaseFeature.value()).thenReturn(Boolean.TRUE);
111110
UserVmJoinVO vm = createMockVm(1L, VM_UUID, VM_NAME, VirtualMachine.State.Running, false);
112111
List<UserVmJoinVO> expiringVms = Arrays.asList(vm);
113112
when(userVmJoinDao.listLeaseInstancesExpiringInDays(anyInt())).thenReturn(expiringVms);

0 commit comments

Comments
 (0)