Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
test: add test to pkg/configurator
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Leigh <[email protected]>
  • Loading branch information
allenlsy committed Jun 8, 2021
1 parent 3e62fd0 commit 04c7667
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/configurator/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

fakeConfig "github.com/openservicemesh/osm/pkg/gen/client/config/clientset/versioned/fake"
testclient "github.com/openservicemesh/osm/pkg/gen/client/config/clientset/versioned/fake"

"github.com/openservicemesh/osm/pkg/announcements"
Expand Down Expand Up @@ -186,3 +187,15 @@ func TestMeshConfigEventTriggers(t *testing.T) {
assert.Equal(tc.expectProxyBroadcast, proxyEventReceived, tc.caseName)
}
}

func TestGetMeshConfig(t *testing.T) {
assert := tassert.New(t)

meshConfigClient := fakeConfig.NewSimpleClientset()
stop := make(chan struct{})
client := newConfigurator(meshConfigClient, stop, osmNamespace, osmMeshConfigName)
meshConfig := client.getMeshConfig()

// returns empty MeshConfig if informer cache is empty
assert.Equal(meshConfig, &v1alpha1.MeshConfig{})
}

0 comments on commit 04c7667

Please sign in to comment.