summaryrefslogtreecommitdiff
path: root/plugins/jobs/oooold/broker/amqp/job_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jobs/oooold/broker/amqp/job_test.go')
-rw-r--r--plugins/jobs/oooold/broker/amqp/job_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/jobs/oooold/broker/amqp/job_test.go b/plugins/jobs/oooold/broker/amqp/job_test.go
new file mode 100644
index 00000000..24ca453b
--- /dev/null
+++ b/plugins/jobs/oooold/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)
+}