@@ -94,19 +94,20 @@ func TestUpdateLoadBalancerZonalNoopAndErrorPaths(t *testing.T) {
9494 }, nil ,
9595 )
9696
97- sku .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).Return ([]* armcompute.ResourceSKU {
98- {
99- Name : pointerutils .ToPtr (string (api .VMSizeStandardD16asV4 )),
100- Locations : pointerutils .ToSlicePtr ([]string {"eastus" }),
101- LocationInfo : pointerutils .ToSlicePtr ([]armcompute.ResourceSKULocationInfo {
102- {
103- Zones : []* string {},
104- },
105- }),
106- Restrictions : pointerutils .ToSlicePtr ([]armcompute.ResourceSKURestrictions {}),
107- ResourceType : pointerutils .ToPtr ("virtualMachines" ),
108- },
109- }, nil )
97+ sku .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).
98+ Return (func (yield func (* armcompute.ResourceSKU , error ) bool ) {
99+ yield (& armcompute.ResourceSKU {
100+ Name : pointerutils .ToPtr (string (api .VMSizeStandardD16asV4 )),
101+ Locations : pointerutils .ToSlicePtr ([]string {"eastus" }),
102+ LocationInfo : pointerutils .ToSlicePtr ([]armcompute.ResourceSKULocationInfo {
103+ {
104+ Zones : []* string {},
105+ },
106+ }),
107+ Restrictions : pointerutils .ToSlicePtr ([]armcompute.ResourceSKURestrictions {}),
108+ ResourceType : pointerutils .ToPtr ("virtualMachines" ),
109+ }, nil )
110+ })
110111 },
111112 expectedLogs : []testlog.ExpectedLogEntry {
112113 {
@@ -136,15 +137,8 @@ func TestUpdateLoadBalancerZonalNoopAndErrorPaths(t *testing.T) {
136137 }, nil ,
137138 )
138139
139- sku .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).Return ([]* armcompute.ResourceSKU {
140- {
141- Name : pointerutils .ToPtr (string (api .VMSizeStandardD16asV4 )),
142- Locations : pointerutils .ToSlicePtr ([]string {"eastus" }),
143- LocationInfo : pointerutils .ToSlicePtr ([]armcompute.ResourceSKULocationInfo {}),
144- Restrictions : pointerutils .ToSlicePtr ([]armcompute.ResourceSKURestrictions {}),
145- ResourceType : pointerutils .ToPtr ("virtualMachines" ),
146- },
147- }, nil )
140+ sku .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).
141+ Return (func (yield func (* armcompute.ResourceSKU , error ) bool ) {})
148142 },
149143 expectedLogs : []testlog.ExpectedLogEntry {},
150144 wantErrs : []error {errVMAvailability },
@@ -170,7 +164,10 @@ func TestUpdateLoadBalancerZonalNoopAndErrorPaths(t *testing.T) {
170164 }, nil ,
171165 )
172166
173- sku .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).Return ([]* armcompute.ResourceSKU {}, errTestSKUFetchError )
167+ sku .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).
168+ Return (func (yield func (* armcompute.ResourceSKU , error ) bool ) {
169+ yield (nil , errTestSKUFetchError )
170+ })
174171 },
175172 expectedLogs : []testlog.ExpectedLogEntry {},
176173 wantErrs : []error {computeskus .ErrListVMResourceSKUs , errTestSKUFetchError },
@@ -380,17 +377,18 @@ func TestUpdateLoadBalancerZonalMigration(t *testing.T) {
380377 }, nil ,
381378 )
382379
383- skus .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).Return ([]* armcompute.ResourceSKU {
384- {
385- Name : pointerutils .ToPtr (string (api .VMSizeStandardD16asV4 )),
386- Locations : pointerutils .ToSlicePtr ([]string {"eastus" }),
387- LocationInfo : pointerutils .ToSlicePtr ([]armcompute.ResourceSKULocationInfo {
388- {Zones : pointerutils .ToSlicePtr ([]string {"1" , "2" , "3" })},
389- }),
390- Restrictions : pointerutils .ToSlicePtr ([]armcompute.ResourceSKURestrictions {}),
391- ResourceType : pointerutils .ToPtr ("virtualMachines" ),
392- },
393- }, nil )
380+ skus .EXPECT ().List (gomock .Any (), "location eq eastus" , false ).
381+ Return (func (yield func (* armcompute.ResourceSKU , error ) bool ) {
382+ yield (& armcompute.ResourceSKU {
383+ Name : pointerutils .ToPtr (string (api .VMSizeStandardD16asV4 )),
384+ Locations : pointerutils .ToSlicePtr ([]string {"eastus" }),
385+ LocationInfo : pointerutils .ToSlicePtr ([]armcompute.ResourceSKULocationInfo {
386+ {Zones : pointerutils .ToSlicePtr ([]string {"1" , "2" , "3" })},
387+ }),
388+ Restrictions : pointerutils .ToSlicePtr ([]armcompute.ResourceSKURestrictions {}),
389+ ResourceType : pointerutils .ToPtr ("virtualMachines" ),
390+ }, nil )
391+ })
394392
395393 plsFIPRemoval := plses .EXPECT ().CreateOrUpdateAndWait (gomock .Any (), rgName , infraID + "-pls" , armnetwork.PrivateLinkService {
396394 Properties : & armnetwork.PrivateLinkServiceProperties {
0 commit comments