* [COMPLIANCE] Update Copyright and License Headers * chore: make gen to generate files with copyright headers * chore: update missed copyright headers --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Co-authored-by: Justin Nguyen <justin.nguyen@hashicorp.com>
33 lines
828 B
Go
33 lines
828 B
Go
// Copyright IBM Corp. 2020, 2025
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package targets
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/boundary/internal/server"
|
|
"github.com/hashicorp/boundary/internal/types/scope"
|
|
pb "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/targets"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestWorkerList_Addresses(t *testing.T) {
|
|
addresses := []string{
|
|
"test1",
|
|
"test2",
|
|
"test3",
|
|
"test4",
|
|
}
|
|
var workerInfos []*pb.WorkerInfo
|
|
var tested server.WorkerList
|
|
for _, a := range addresses {
|
|
workerInfos = append(workerInfos, &pb.WorkerInfo{Address: a})
|
|
tested = append(tested, server.NewWorker(scope.Global.String(),
|
|
server.WithName(a),
|
|
server.WithAddress(a)))
|
|
}
|
|
assert.Equal(t, addresses, tested.Addresses())
|
|
assert.Equal(t, workerInfos, tested.WorkerInfos())
|
|
}
|