Skip to content

Commit a84d2d7

Browse files
committed
explicitly set offering bounds
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent e28e177 commit a84d2d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

server/src/test/java/com/cloud/vm/UserVmManagerImplTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
import org.apache.cloudstack.acl.ControlledEntity;
4949
import org.apache.cloudstack.acl.SecurityChecker;
50+
import org.apache.cloudstack.api.ApiConstants;
5051
import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
5152
import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
5253
import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
@@ -3140,7 +3141,6 @@ private ServiceOfferingVO getMockedServiceOffering(boolean custom, boolean custo
31403141
when(serviceOffering.isCustomCpuSpeedSupported()).thenReturn(false);
31413142
when(serviceOffering.getSpeed()).thenReturn(1000);
31423143
}
3143-
System.out.println("Service Offering customized: " + serviceOffering.isCustomized() + ", speed: " + serviceOffering.getSpeed());
31443144
return serviceOffering;
31453145
}
31463146

@@ -3169,6 +3169,12 @@ public void cpuSpeedCustomizationNotAllowedThrowsException() {
31693169
public void cpuSpeedCustomizationAllowedDoesNotThrowException() {
31703170
ServiceOfferingVO serviceOffering = getMockedServiceOffering(true, true);
31713171

3172+
when(serviceOfferingDetailsDao.listDetailsKeyPairs(anyLong())).thenReturn(
3173+
Map.of(ApiConstants.MIN_CPU_NUMBER, "1",
3174+
ApiConstants.MAX_CPU_NUMBER, "4",
3175+
ApiConstants.MIN_MEMORY, "256",
3176+
ApiConstants.MAX_MEMORY, "8192"));
3177+
31723178
Map<String, String> customParameters = new HashMap<>();
31733179
customParameters.put(VmDetailConstants.CPU_NUMBER, "1");
31743180
customParameters.put(VmDetailConstants.CPU_SPEED, "2500");

0 commit comments

Comments
 (0)