Files
tasks/common/nexus/nexusrpc/handle_test.go
Roey BermanandGitHub 54771da7a7 Inline code from the Nexus SDK (#8482)
## What changed?

Inlined the server and client code from the Nexus SDK

## Why?

The protocol has been deemed to stay experimental for a while longer and
we want to get trim Nexus Go SDK to the bare minimum.

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
2025-10-15 07:40:19 -07:00

20 lines
588 B
Go

package nexusrpc
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestNewHandleFailureConditions(t *testing.T) {
client, err := NewHTTPClient(HTTPClientOptions{BaseURL: "http://foo.com", Service: "test"})
require.NoError(t, err)
_, err = client.NewOperationHandle("", "token")
require.ErrorIs(t, err, errEmptyOperationName)
_, err = client.NewOperationHandle("name", "")
require.ErrorIs(t, err, errEmptyOperationToken)
_, err = client.NewOperationHandle("", "")
require.ErrorIs(t, err, errEmptyOperationName)
require.ErrorIs(t, err, errEmptyOperationToken)
}