summaryrefslogtreecommitdiff
path: root/plugins/temporal/protocol/converter_test.go
blob: 6ce9fa0fe51e630effbf09ca2f405afc9c8f86ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package protocol

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"go.temporal.io/api/common/v1"
	"go.temporal.io/sdk/converter"
)

func Test_Passthough(t *testing.T) {
	codec := NewDataConverter(converter.GetDefaultDataConverter())

	value, err := codec.ToPayloads("test")
	assert.NoError(t, err)

	out := &common.Payloads{}

	assert.Len(t, out.Payloads, 0)
	assert.NoError(t, codec.FromPayloads(value, &out))

	assert.Len(t, out.Payloads, 1)
}