Skip to content

Commit 884b4fd

Browse files
committed
test: simplify redis sentinel config test
1 parent 754ae79 commit 884b4fd

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

internal/common/config/config_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"time"
88

99
"github.com/stretchr/testify/assert"
10+
"github.com/stretchr/testify/require"
1011
)
1112

1213
func TestResolveEnv(t *testing.T) {
@@ -107,13 +108,10 @@ auth:
107108
sentinel_password: "${OAUTH2_REDIS_SENTINEL_PASSWORD:}"
108109
`
109110
file := filepath.Join(tmp, "mcp-gateway.yaml")
110-
assert.NoError(t, os.WriteFile(file, []byte(yaml), 0o644))
111+
require.NoError(t, os.WriteFile(file, []byte(yaml), 0o644))
111112

112113
cfg, _, err := LoadConfig[MCPGatewayConfig]("mcp-gateway.yaml")
113-
assert.NoError(t, err)
114-
if err != nil {
115-
return
116-
}
114+
require.NoError(t, err)
117115
assert.Equal(t, "sentinel-notifier", cfg.Notifier.Redis.SentinelUsername)
118116
assert.Equal(t, "notifier-pass", cfg.Notifier.Redis.SentinelPassword)
119117
assert.Equal(t, "sentinel-session", cfg.Session.Redis.SentinelUsername)

0 commit comments

Comments
 (0)