mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Fix unit tests after vendor upgrades
This commit is contained in:
parent
bee44da7a2
commit
b793209080
@ -380,8 +380,10 @@ func TestListWithNextPage(t *testing.T) {
|
||||
resourceID := "/subscriptions/subscriptionID/resourceGroups/rg/providers/Microsoft.ContainerService/managedClusters"
|
||||
armClient := mockarmclient.NewMockInterface(ctrl)
|
||||
mcList := []containerservice.ManagedCluster{getTestManagedCluster("cluster"), getTestManagedCluster("cluster1"), getTestManagedCluster("cluster2")}
|
||||
responseBody, err := json.Marshal(containerservice.ManagedClusterListResult{Value: &mcList, NextLink: to.StringPtr("nextLink")})
|
||||
// ManagedClusterListResult.MarshalJson() doesn't include "nextLink" in its result, hence responseBody is composed manually below.
|
||||
responseBody, err := json.Marshal(map[string]interface{}{"value": mcList, "nextLink": "nextLink"})
|
||||
assert.NoError(t, err)
|
||||
|
||||
pagedResponse, err := json.Marshal(containerservice.ManagedClusterListResult{Value: &mcList})
|
||||
assert.NoError(t, err)
|
||||
armClient.EXPECT().PrepareGetRequest(gomock.Any(), gomock.Any()).Return(&http.Request{}, nil)
|
||||
|
@ -378,7 +378,8 @@ func TestListWithNextPage(t *testing.T) {
|
||||
resourceID := "/subscriptions/subscriptionID/resourceGroups/rg/providers/Microsoft.Resources/deployments"
|
||||
armClient := mockarmclient.NewMockInterface(ctrl)
|
||||
dpList := []resources.DeploymentExtended{getTestDeploymentExtended("dep"), getTestDeploymentExtended("dep1"), getTestDeploymentExtended("dep2")}
|
||||
partialResponse, err := json.Marshal(resources.DeploymentListResult{Value: &dpList, NextLink: to.StringPtr("nextLink")})
|
||||
// DeploymentListResult.MarshalJson() doesn't include "nextLink" in its result, hence partialResponse is composed manually below.
|
||||
partialResponse, err := json.Marshal(map[string]interface{}{"value": dpList, "nextLink": "nextLink"})
|
||||
assert.NoError(t, err)
|
||||
pagedResponse, err := json.Marshal(resources.DeploymentListResult{Value: &dpList})
|
||||
assert.NoError(t, err)
|
||||
|
@ -172,7 +172,8 @@ func TestListWithNextPage(t *testing.T) {
|
||||
resourceID := "/subscriptions/subscriptionID/resourceGroups/rg/providers/Microsoft.Network/loadBalancers"
|
||||
armClient := mockarmclient.NewMockInterface(ctrl)
|
||||
lbList := []network.LoadBalancer{getTestLoadBalancer("lb1"), getTestLoadBalancer("lb2"), getTestLoadBalancer("lb3")}
|
||||
partialResponse, err := json.Marshal(network.LoadBalancerListResult{Value: &lbList, NextLink: to.StringPtr("nextLink")})
|
||||
// LoadBalancerListResult.MarshalJson() doesn't include "nextLink" in its result, hence partialResponse is composed manually below.
|
||||
partialResponse, err := json.Marshal(map[string]interface{}{"value": lbList, "nextLink": "nextLink"})
|
||||
assert.NoError(t, err)
|
||||
pagedResponse, err := json.Marshal(network.LoadBalancerListResult{Value: &lbList})
|
||||
assert.NoError(t, err)
|
||||
|
Loading…
Reference in New Issue
Block a user