|
47 | 47 |
|
48 | 48 | import org.apache.cloudstack.acl.ControlledEntity; |
49 | 49 | import org.apache.cloudstack.acl.SecurityChecker; |
| 50 | +import org.apache.cloudstack.api.ApiConstants; |
50 | 51 | import org.apache.cloudstack.api.BaseCmd.HTTPMethod; |
51 | 52 | import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd; |
52 | 53 | import org.apache.cloudstack.api.command.user.vm.DeployVMCmd; |
@@ -3140,7 +3141,6 @@ private ServiceOfferingVO getMockedServiceOffering(boolean custom, boolean custo |
3140 | 3141 | when(serviceOffering.isCustomCpuSpeedSupported()).thenReturn(false); |
3141 | 3142 | when(serviceOffering.getSpeed()).thenReturn(1000); |
3142 | 3143 | } |
3143 | | - System.out.println("Service Offering customized: " + serviceOffering.isCustomized() + ", speed: " + serviceOffering.getSpeed()); |
3144 | 3144 | return serviceOffering; |
3145 | 3145 | } |
3146 | 3146 |
|
@@ -3169,6 +3169,12 @@ public void cpuSpeedCustomizationNotAllowedThrowsException() { |
3169 | 3169 | public void cpuSpeedCustomizationAllowedDoesNotThrowException() { |
3170 | 3170 | ServiceOfferingVO serviceOffering = getMockedServiceOffering(true, true); |
3171 | 3171 |
|
| 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 | + |
3172 | 3178 | Map<String, String> customParameters = new HashMap<>(); |
3173 | 3179 | customParameters.put(VmDetailConstants.CPU_NUMBER, "1"); |
3174 | 3180 | customParameters.put(VmDetailConstants.CPU_SPEED, "2500"); |
|
0 commit comments