@@ -72,10 +72,11 @@ func TestValidateCapacity(t *testing.T) {
7272 errorSubstring : "invalid capacity value" ,
7373 },
7474 {
75- name : "invalid value of zero for capacity replaced with minimum" ,
76- value : "0" ,
77- operator : placementv1beta1 .PropertySelectorGreaterThanOrEqualTo ,
78- wantValue : 1 ,
75+ name : "invalid value of zero for capacity" ,
76+ value : "0" ,
77+ operator : placementv1beta1 .PropertySelectorGreaterThanOrEqualTo ,
78+ wantError : true ,
79+ errorSubstring : "is below minimum allowed value" ,
7980 },
8081 {
8182 name : "capacity equal to max limit with GreaterThan operator" ,
@@ -178,14 +179,15 @@ func TestExtractCapacityRequirements(t *testing.T) {
178179 errorSubstring : "exceeds maximum allowed value of 200" ,
179180 },
180181 {
181- name : "invalid Azure SKU capacity property exceeding min limit" ,
182+ name : "invalid Azure SKU capacity property below min limit" ,
182183 req : placementv1beta1.PropertySelectorRequirement {
183184 Name : fmt .Sprintf (azure .CapacityPerSKUPropertyTmpl , "Standard_B2ms" ),
184185 Operator : placementv1beta1 .PropertySelectorGreaterThanOrEqualTo ,
185- Values : []string {"1 " },
186+ Values : []string {"0 " },
186187 },
187- wantSKU : "Standard_B2ms" ,
188- wantCapacityValue : 1 ,
188+ wantSKU : "Standard_B2ms" ,
189+ wantError : true ,
190+ errorSubstring : "is below minimum allowed value" ,
189191 },
190192 {
191193 name : "invalid Azure SKU capacity property with decimal" ,
@@ -296,7 +298,7 @@ func TestExtractCapacityRequirements(t *testing.T) {
296298}
297299
298300func TestCheckIfMeetSKUCapacityRequirement (t * testing.T ) {
299- // Prepare test data
301+ // Prepare test data.
300302 validSKU := "Standard_D2s_v3"
301303 validPropertySelectorRequirement := placementv1beta1.PropertySelectorRequirement {
302304 Name : fmt .Sprintf (azure .CapacityPerSKUPropertyTmpl , validSKU ),
@@ -417,7 +419,7 @@ func TestCheckIfMeetSKUCapacityRequirement(t *testing.T) {
417419 errorSubstring : "unsupported operator \" Eq\" for SKU capacity property, only GreaterThan (Gt) and GreaterThanOrEqualTo (Ge) are supported" ,
418420 },
419421 {
420- name : "too low value in requirement replaced with minimum capacity " ,
422+ name : "too low value in requirement" ,
421423 cluster : cluster ,
422424 sku : validSKU ,
423425 targetCapacity : 1 ,
@@ -426,8 +428,8 @@ func TestCheckIfMeetSKUCapacityRequirement(t *testing.T) {
426428 Operator : placementv1beta1 .PropertySelectorGreaterThanOrEqualTo ,
427429 Values : []string {"0" },
428430 },
429- mockStatusCode : http . StatusOK ,
430- wantAvailable : true ,
431+ wantError : true ,
432+ errorSubstring : "is below minimum allowed value" ,
431433 },
432434 {
433435 name : "cases-insensitive request - available SKU" ,
0 commit comments