Skip to content

Commit

Permalink
Update mock file to match rename of graph service struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Aman committed Jan 18, 2019
1 parent e67f1a6 commit 9c4f15e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
12 changes: 0 additions & 12 deletions internal/auth/providers/azure_graph_mock.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/auth/providers/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func TestAzureV2ProviderRedeem(t *testing.T) {
testutil.Equal(t, nil, err)

// graph service mock has to be set after p.Configure
p.GraphService = &MockAzureGraphService{}
p.GraphService = &MockMSGraphService{}

session, err := p.Redeem("http://redirect/", "code1234")
if tc.expectedError && err == nil {
Expand Down Expand Up @@ -540,7 +540,7 @@ func TestAzureV2ValidateGroupMembers(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
p := newAzureV2Provider(nil)
p.GraphService = &MockAzureGraphService{
p.GraphService = &MockMSGraphService{
Groups: tc.mockedGroups,
GroupsError: tc.mockedError,
}
Expand Down
12 changes: 12 additions & 0 deletions internal/auth/providers/ms_graph_mock.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package providers

// MockMSGraphService is an implementation of GraphService to be used for testing
type MockMSGraphService struct {
Groups []string
GroupsError error
}

// GetGroups mocks the GetGroups function
func (ms *MockMSGraphService) GetGroups(string) ([]string, error) {
return ms.Groups, ms.GroupsError
}

0 comments on commit 9c4f15e

Please sign in to comment.