summaryrefslogtreecommitdiff
path: root/plugins/jobs/structs/job_test.go
blob: 92f78081b320114c35b18586ffd1a4fd7225369c (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", Options: &Options{ID: "id"}}

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