github.com/hellofresh/janus@v0.0.0-20230925145208-ce8de8183c67/pkg/plugin/rate/setup_integration_test.go (about) 1 package rate 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 8 "github.com/hellofresh/janus/pkg/proxy" 9 ) 10 11 func TestRateLimitPluginRedisPolicy(t *testing.T) { 12 rawConfig := map[string]interface{}{ 13 "limit": "10-S", 14 "policy": "redis", 15 "redis": map[string]interface{}{ 16 "dsn": "localhost", 17 "prefix": "test", 18 }, 19 } 20 21 def := proxy.NewRouterDefinition(proxy.NewDefinition()) 22 err := setupRateLimit(def, rawConfig) 23 24 assert.Error(t, err) 25 }