-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UML-3724 consuming event and added tests
- Loading branch information
1 parent
070c2a3
commit 1632bf1
Showing
13 changed files
with
324 additions
and
38 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/aws/aws-sdk-go-v2/aws" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/ministryofjustice/opg-use-an-lpa/app/mocks" | ||
) | ||
|
||
func TestFactory_GetLogger(t *testing.T) { | ||
mockLogger := new(mocks.Logger) | ||
mockAWSConfig := aws.Config{} | ||
|
||
factory := NewFactory(mockAWSConfig, mockLogger) | ||
|
||
assert.Equal(t, mockLogger, factory.GetLogger()) | ||
} | ||
|
||
func TestFactory_GetAWSConfig(t *testing.T) { | ||
mockLogger := new(mocks.Logger) | ||
mockAWSConfig := aws.Config{} | ||
|
||
factory := NewFactory(mockAWSConfig, mockLogger) | ||
|
||
assert.Equal(t, mockAWSConfig, factory.GetAWSConfig()) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
"context" | ||
"encoding/json" | ||
|
||
"github.com/stretchr/testify/mock" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/ministryofjustice/opg-use-an-lpa/app/mocks" | ||
"github.com/aws/aws-lambda-go/events" | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/mock" | ||
"github.com/ministryofjustice/opg-use-an-lpa/app/mocks" | ||
) | ||
|
||
func TestLogger_Info(t *testing.T) { | ||
mockLogger := new(mocks.Logger) | ||
|
||
mockLogger.On("Info", "Test info log").Return() | ||
|
||
mockLogger.Info("Test info log") | ||
|
||
mockLogger.AssertExpectations(t) | ||
} | ||
|
||
func TestLogger_Warn(t *testing.T) { | ||
mockLogger := new(mocks.Logger) | ||
|
||
mockLogger.On("Warn", "Test warn log", mock.Anything).Return() | ||
|
||
mockLogger.Warn("Test warn log", nil) | ||
|
||
mockLogger.AssertExpectations(t) | ||
} | ||
|
||
func TestLogger_Error(t *testing.T) { | ||
mockLogger := new(mocks.Logger) | ||
|
||
mockLogger.On("Error", "Test error log", mock.Anything).Return() | ||
|
||
mockLogger.Error("Test error log", nil) | ||
|
||
mockLogger.AssertExpectations(t) | ||
} |
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
47 changes: 47 additions & 0 deletions
47
lambda-functions/event-receiver/app/mocks/CloudWatchHandler.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.