summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-05 17:10:10 +0300
committerValery Piashchynski <[email protected]>2020-11-05 17:10:10 +0300
commite76536ce9310552547bdae3ad46ebd08dbd2bb4a (patch)
tree27c8bca0030f88b42b4743f13ce811d8d991de67
parent043be1537393375f71f2e96708ec5d045bfab190 (diff)
Move magic string to the constants (test)
-rw-r--r--plugins/app/tests/plugin_pipes.go7
-rw-r--r--plugins/app/tests/plugin_sockets.go6
-rw-r--r--plugins/app/tests/plugin_tcp.go6
3 files changed, 10 insertions, 9 deletions
diff --git a/plugins/app/tests/plugin_pipes.go b/plugins/app/tests/plugin_pipes.go
index 704ec988..fc999718 100644
--- a/plugins/app/tests/plugin_pipes.go
+++ b/plugins/app/tests/plugin_pipes.go
@@ -11,6 +11,7 @@ import (
)
const ConfigSection = "app"
+const Response = "test"
var testPoolConfig = roadrunner.Config{
NumWorkers: 10,
@@ -44,7 +45,7 @@ func (f *Foo) Serve() chan error {
// test payload for echo
r := roadrunner.Payload{
Context: nil,
- Body: []byte("test"),
+ Body: []byte(Response),
}
errCh := make(chan error, 1)
@@ -88,7 +89,7 @@ func (f *Foo) Serve() chan error {
return errCh
}
- if string(rsp.Body) != "test" {
+ if string(rsp.Body) != Response {
errCh <- errors.E("response from worker is wrong", errors.Errorf("response: %s", rsp.Body))
return errCh
}
@@ -115,7 +116,7 @@ func (f *Foo) Serve() chan error {
}
// echo of the "test" should be -> test
- if string(rsp.Body) != "test" {
+ if string(rsp.Body) != Response {
errCh <- errors.E("response from worker is wrong", errors.Errorf("response: %s", rsp.Body))
return errCh
}
diff --git a/plugins/app/tests/plugin_sockets.go b/plugins/app/tests/plugin_sockets.go
index 2b7da312..585264f6 100644
--- a/plugins/app/tests/plugin_sockets.go
+++ b/plugins/app/tests/plugin_sockets.go
@@ -30,7 +30,7 @@ func (f *Foo2) Serve() chan error {
// test payload for echo
r := roadrunner.Payload{
Context: nil,
- Body: []byte("test"),
+ Body: []byte(Response),
}
err = f.configProvider.UnmarshalKey(ConfigSection, conf)
@@ -70,7 +70,7 @@ func (f *Foo2) Serve() chan error {
return errCh
}
- if string(rsp.Body) != "test" {
+ if string(rsp.Body) != Response {
errCh <- errors.E("response from worker is wrong", errors.Errorf("response: %s", rsp.Body))
return errCh
}
@@ -97,7 +97,7 @@ func (f *Foo2) Serve() chan error {
}
// echo of the "test" should be -> test
- if string(rsp.Body) != "test" {
+ if string(rsp.Body) != Response {
errCh <- errors.E("response from worker is wrong", errors.Errorf("response: %s", rsp.Body))
return errCh
}
diff --git a/plugins/app/tests/plugin_tcp.go b/plugins/app/tests/plugin_tcp.go
index 1a236db0..6abc533d 100644
--- a/plugins/app/tests/plugin_tcp.go
+++ b/plugins/app/tests/plugin_tcp.go
@@ -30,7 +30,7 @@ func (f *Foo3) Serve() chan error {
// test payload for echo
r := roadrunner.Payload{
Context: nil,
- Body: []byte("test"),
+ Body: []byte(Response),
}
err = f.configProvider.UnmarshalKey(ConfigSection, conf)
@@ -70,7 +70,7 @@ func (f *Foo3) Serve() chan error {
return errCh
}
- if string(rsp.Body) != "test" {
+ if string(rsp.Body) != Response {
errCh <- errors.E("response from worker is wrong", errors.Errorf("response: %s", rsp.Body))
return errCh
}
@@ -97,7 +97,7 @@ func (f *Foo3) Serve() chan error {
}
// echo of the "test" should be -> test
- if string(rsp.Body) != "test" {
+ if string(rsp.Body) != Response {
errCh <- errors.E("response from worker is wrong", errors.Errorf("response: %s", rsp.Body))
return errCh
}