summaryrefslogtreecommitdiff
path: root/plugins/jobs/broker/amqp/job_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-15 22:12:32 +0300
committerValery Piashchynski <[email protected]>2021-06-15 22:12:32 +0300
commitd4c92e48bada7593b6fbec612a742c599de6e736 (patch)
tree53b6fb81987953b71a77ae094e579a0a7daa407c /plugins/jobs/broker/amqp/job_test.go
parent9dc98d43b0c0de3e1e1bd8fdc97c122c7c7c594f (diff)
- Jobs plugin initial commit
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/broker/amqp/job_test.go')
-rw-r--r--plugins/jobs/broker/amqp/job_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/jobs/broker/amqp/job_test.go b/plugins/jobs/broker/amqp/job_test.go
new file mode 100644
index 00000000..24ca453b
--- /dev/null
+++ b/plugins/jobs/broker/amqp/job_test.go
@@ -0,0 +1,29 @@
+package amqp
+
+import (
+ "github.com/streadway/amqp"
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func Test_Unpack_Errors(t *testing.T) {
+ _, _, _, err := unpack(amqp.Delivery{
+ Headers: map[string]interface{}{},
+ })
+ assert.Error(t, err)
+
+ _, _, _, err = unpack(amqp.Delivery{
+ Headers: map[string]interface{}{
+ "rr-id": "id",
+ },
+ })
+ assert.Error(t, err)
+
+ _, _, _, err = unpack(amqp.Delivery{
+ Headers: map[string]interface{}{
+ "rr-id": "id",
+ "rr-attempt": int64(0),
+ },
+ })
+ assert.Error(t, err)
+}