-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version: minorMFW 2622 send alerts to cloud (#146)
version: minor * add timestamp to protobuf alert; set timestamp in Send func; * made credentials manager more mockable
- Loading branch information
1 parent
535ad08
commit 52234b5
Showing
4 changed files
with
63 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
package mocks | ||
|
||
import "github.com/untangle/golang-shared/services/credentialsmanager" | ||
import ( | ||
"github.com/stretchr/testify/mock" | ||
) | ||
|
||
type mockCredentialsManager struct{} | ||
type mockCredentialsManager struct { | ||
mock.Mock | ||
} | ||
|
||
func NewMockCredentialsManager() credentialsmanager.CredentialsManager { | ||
func NewMockCredentialsManager() *mockCredentialsManager { | ||
return &mockCredentialsManager{} | ||
} | ||
|
||
func (m *mockCredentialsManager) Startup() error { return nil } | ||
func (m *mockCredentialsManager) Shutdown() error { return nil } | ||
func (m *mockCredentialsManager) GetToken(key string) string { return "" } | ||
func (m *mockCredentialsManager) Startup() error { return nil } | ||
func (m *mockCredentialsManager) Shutdown() error { return nil } | ||
func (m *mockCredentialsManager) GetToken(key string) string { | ||
// this is required for mocking this function's call result | ||
args := m.Called(key) | ||
return args.String(0) | ||
} | ||
func (m *mockCredentialsManager) Name() string { | ||
return "Mocked Credentials Manager" | ||
} |