summaryrefslogtreecommitdiff
path: root/plugins/jobs/structs/job_test.go
blob: e7240c6ba98a936347a3ab9cc1fc38c052ccd895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package structs

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestJob_Body(t *testing.T) {
	j := &Job{Payload: "hello"}

	assert.Equal(t, []byte("hello"), j.Body())
}

func TestJob_Context(t *testing.T) {
	j := &Job{Job: "job"}

	assert.Equal(t, []byte(`{"id":"id","job":"job"}`), j.Context("id"))
}