summaryrefslogtreecommitdiff
path: root/tests/plugins/jobs/jobs_amqp_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-07-23 13:25:09 +0300
committerValery Piashchynski <[email protected]>2021-07-23 13:25:09 +0300
commit9079cc51599d6e21ac59e34573f7bbf2e2e87b9e (patch)
tree2e0332039ef90030a49c1878025a30ba6e49acf7 /tests/plugins/jobs/jobs_amqp_test.go
parentf585c654027f6dc40d7e3a3cdf7906006ed2427a (diff)
Tests refactoring
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins/jobs/jobs_amqp_test.go')
-rw-r--r--tests/plugins/jobs/jobs_amqp_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/plugins/jobs/jobs_amqp_test.go b/tests/plugins/jobs/jobs_amqp_test.go
index 8f87072b..cbbf43d8 100644
--- a/tests/plugins/jobs/jobs_amqp_test.go
+++ b/tests/plugins/jobs/jobs_amqp_test.go
@@ -24,6 +24,7 @@ import (
jobsv1beta "github.com/spiral/roadrunner/v2/proto/jobs/v1beta"
"github.com/spiral/roadrunner/v2/tests/mocks"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
func TestAMQPInit(t *testing.T) {
@@ -239,3 +240,33 @@ func declareAMQPPipe(t *testing.T) {
err = client.Call("jobs.Declare", pipe, er)
assert.NoError(t, err)
}
+
+func TestAMQPNoGlobalSection(t *testing.T) {
+ cont, err := endure.NewContainer(nil, endure.SetLogLevel(endure.ErrorLevel))
+ assert.NoError(t, err)
+
+ cfg := &config.Viper{
+ Path: "amqp/.rr-no-global.yaml",
+ Prefix: "rr",
+ }
+
+ err = cont.RegisterAll(
+ cfg,
+ &server.Plugin{},
+ &rpcPlugin.Plugin{},
+ &logger.ZapLogger{},
+ &jobs.Plugin{},
+ &resetter.Plugin{},
+ &informer.Plugin{},
+ &amqp.Plugin{},
+ )
+ assert.NoError(t, err)
+
+ err = cont.Init()
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ _, err = cont.Serve()
+ require.Error(t, err)
+}