Skip to content

Commit

Permalink
fix: fix ut error
Browse files Browse the repository at this point in the history
Signed-off-by: kaku <[email protected]>
  • Loading branch information
likakuli committed May 9, 2022
1 parent be10e6c commit e254179
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions transport_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/k-cloud-labs/pkg/test/helper"
"github.com/k-cloud-labs/pkg/test/mock"
"github.com/k-cloud-labs/pkg/util"
converter "github.com/k-cloud-labs/pkg/util/converter"
"github.com/k-cloud-labs/pkg/util/converter"
)

func TestPolicyTransport_RoundTrip(t *testing.T) {
Expand Down Expand Up @@ -86,11 +86,11 @@ func TestPolicyTransport_RoundTrip(t *testing.T) {

opLister.EXPECT().List(labels.Everything()).Return([]*policyv1alpha1.OverridePolicy{
overridePolicy1,
}, nil)
}, nil).AnyTimes()

copLister.EXPECT().List(labels.Everything()).Return([]*policyv1alpha1.ClusterOverridePolicy{
overridePolicy2,
}, nil)
}, nil).AnyTimes()

manager := overridemanager.NewOverrideManager(copLister, opLister)

Expand All @@ -112,8 +112,8 @@ func TestPolicyTransport_RoundTrip(t *testing.T) {
wantedErr: nil,
wantedAnnotations: map[string]string{
"foo": "bar",
util.AppliedOverrides: `[{"policyName":"overridePolicy1","overriders":{"plaintext":[{"path":"/metadata/annotations","operator":"add","value":{"foo":"bar"}}]}}]`,
util.AppliedClusterOverrides: `[{"policyName":"overridePolicy2","overriders":{"plaintext":[{"path":"/metadata/annotations","operator":"add","value":{"hello":"world"}}]}}]`,
util.AppliedOverrides: `[{"policyName":"overridePolicy1","overriders":{"plaintext":[{"path":"/metadata/annotations","op":"add","value":{"foo":"bar"}}]}}]`,
util.AppliedClusterOverrides: `[{"policyName":"overridePolicy2","overriders":{"plaintext":[{"path":"/metadata/annotations","op":"add","value":{"hello":"world"}}]}}]`,
},
},
}
Expand Down

0 comments on commit e254179

Please sign in to comment.