1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package oooold import ( "github.com/stretchr/testify/assert" "testing" ) 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")) }