Skip to content

Commit 4bcb916

Browse files
author
Heeyoung Jung
committed
incorporated unsupoorted error types for unit testing
1 parent 7221ed2 commit 4bcb916

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/monitor/sqsevent/sqs-monitor_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ func TestSendHeartbeats_NormalClosure(t *testing.T) {
968968
func TestSendHeartbeats_ErrThrottlingASG(t *testing.T) {
969969
asgMock := h.MockedASG{
970970
RecordLifecycleActionHeartbeatResp: autoscaling.RecordLifecycleActionHeartbeatOutput{},
971-
RecordLifecycleActionHeartbeatErr: awserr.NewRequestFailure(aws.ErrThrottling, 400, "bad-request"),
971+
RecordLifecycleActionHeartbeatErr: awserr.New("ThrottlingException", "Rate exceeded", nil),
972972
}
973973

974974
sqsMonitor := sqsevent.SQSMonitor{
@@ -997,7 +997,7 @@ func TestSendHeartbeats_ErrThrottlingASG(t *testing.T) {
997997
func TestSendHeartbeats_ErrInvalidTarget(t *testing.T) {
998998
asgMock := h.MockedASG{
999999
RecordLifecycleActionHeartbeatResp: autoscaling.RecordLifecycleActionHeartbeatOutput{},
1000-
RecordLifecycleActionHeartbeatErr: awserr.NewRequestFailure(aws.ErrValidation, 400, "bad-request"),
1000+
RecordLifecycleActionHeartbeatErr: awserr.New("ValidationError", "No active Lifecycle Action found", nil),
10011001
}
10021002

10031003
sqsMonitor := sqsevent.SQSMonitor{

0 commit comments

Comments
 (0)