summaryrefslogtreecommitdiff
path: root/plugins/websockets/validator/access_validator_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-05-31 16:05:00 +0300
committerValery Piashchynski <[email protected]>2021-05-31 16:05:00 +0300
commit49703d70a3ede70ce9a0cab824cbcb96dbf824c0 (patch)
tree181d72a3321d52c960a519ba3a233e3e7fe8e86a /plugins/websockets/validator/access_validator_test.go
parent0ee91dc24d3e68706d89092c06b1c0d09dab0353 (diff)
- Rework access_validators
- WS plugin uses it's own pool to handle requests on the /ws (or any user-defined) endpoint - Ability to write custom validators Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/websockets/validator/access_validator_test.go')
-rw-r--r--plugins/websockets/validator/access_validator_test.go35
1 files changed, 0 insertions, 35 deletions
diff --git a/plugins/websockets/validator/access_validator_test.go b/plugins/websockets/validator/access_validator_test.go
deleted file mode 100644
index 4a07b00f..00000000
--- a/plugins/websockets/validator/access_validator_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package validator
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestResponseWrapper_Body(t *testing.T) {
- w := NewValidator()
- _, _ = w.Write([]byte("hello"))
-
- assert.Equal(t, []byte("hello"), w.Body())
-}
-
-func TestResponseWrapper_Header(t *testing.T) {
- w := NewValidator()
- w.Header().Set("k", "value")
-
- assert.Equal(t, "value", w.Header().Get("k"))
-}
-
-func TestResponseWrapper_StatusCode(t *testing.T) {
- w := NewValidator()
- w.WriteHeader(200)
-
- assert.True(t, w.IsOK())
-}
-
-func TestResponseWrapper_StatusCodeBad(t *testing.T) {
- w := NewValidator()
- w.WriteHeader(400)
-
- assert.False(t, w.IsOK())
-}