Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clients/http/deviceprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func NewDeviceProfileClientWithUrlCallback(baseUrlFunc clients.ClientBaseUrlFunc
return &DeviceProfileClient{
baseUrlFunc: baseUrlFunc,
authInjector: authInjector,
resourcesCache: make(map[string]responses.DeviceResourceResponse),
enableNameFieldEscape: enableNameFieldEscape,
}
}
Expand Down
10 changes: 9 additions & 1 deletion clients/http/deviceprofile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,20 @@ import (
"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/requests"
"github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/responses"
edgexErrors "github.com/edgexfoundry/go-mod-core-contracts/v4/errors"

"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestNewDeviceProfileClientWithUrlCallback(t *testing.T) {
baseUrlFunc := func() (string, error) {
return "", nil
}
client := NewDeviceProfileClientWithUrlCallback(baseUrlFunc, &emptyAuthenticationInjector{}, true)
require.NotNil(t, client)
require.NotNil(t, client.(*DeviceProfileClient).resourcesCache)
}

func TestAddDeviceProfiles(t *testing.T) {
requestId := uuid.New().String()

Expand Down