Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pulak-opti committed Nov 24, 2023
1 parent a6eee8b commit da5782e
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions pkg/handlers/notification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,19 +362,19 @@ func TestDefaultNotificationReceiver(t *testing.T) {
}

func TestRedisNotificationReceiver(t *testing.T) {
// conf := config.SyncConfig{
// Pubsub: map[string]interface{}{
// "redis": map[string]interface{}{
// "host": "localhost:6379",
// "password": "",
// "database": 0,
// },
// },
// Notification: config.FeatureSyncConfig{
// Enable: true,
// Default: "redis",
// },
// }
conf := config.SyncConfig{
Pubsub: map[string]interface{}{
"redis": map[string]interface{}{
"host": "localhost:6379",
"password": "",
"database": 0,
},
},
Notification: config.FeatureSyncConfig{
Enable: true,
Default: "redis",
},
}
type args struct {
conf config.SyncConfig
ctx context.Context
Expand All @@ -384,16 +384,16 @@ func TestRedisNotificationReceiver(t *testing.T) {
args args
want NotificationReceiverFunc
}{
// {
// name: "Test happy path",
// args: args{
// conf: conf,
// ctx: context.WithValue(context.Background(), SDKKey, "random-sdk-key-1"),
// },
// want: func(ctx context.Context) (<-chan syncer.Event, error) {
// return make(<-chan syncer.Event), nil
// },
// },
{
name: "Test happy path",
args: args{
conf: conf,
ctx: context.WithValue(context.Background(), SDKKey, "random-sdk-key-1"),
},
want: func(ctx context.Context) (<-chan syncer.Event, error) {
return make(<-chan syncer.Event), nil
},
},
{
name: "Test empty config",
args: args{
Expand Down

0 comments on commit da5782e

Please sign in to comment.