File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ func NewDeviceProfileClientWithUrlCallback(baseUrlFunc clients.ClientBaseUrlFunc
4848 return & DeviceProfileClient {
4949 baseUrlFunc : baseUrlFunc ,
5050 authInjector : authInjector ,
51+ resourcesCache : make (map [string ]responses.DeviceResourceResponse ),
5152 enableNameFieldEscape : enableNameFieldEscape ,
5253 }
5354}
Original file line number Diff line number Diff line change @@ -24,12 +24,20 @@ import (
2424 "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/requests"
2525 "github.com/edgexfoundry/go-mod-core-contracts/v4/dtos/responses"
2626 edgexErrors "github.com/edgexfoundry/go-mod-core-contracts/v4/errors"
27-
2827 "github.com/google/uuid"
2928 "github.com/stretchr/testify/assert"
3029 "github.com/stretchr/testify/require"
3130)
3231
32+ func TestNewDeviceProfileClientWithUrlCallback (t * testing.T ) {
33+ baseUrlFunc := func () (string , error ) {
34+ return "" , nil
35+ }
36+ client := NewDeviceProfileClientWithUrlCallback (baseUrlFunc , & emptyAuthenticationInjector {}, true )
37+ require .NotNil (t , client )
38+ require .NotNil (t , client .(* DeviceProfileClient ).resourcesCache )
39+ }
40+
3341func TestAddDeviceProfiles (t * testing.T ) {
3442 requestId := uuid .New ().String ()
3543
You can’t perform that action at this time.
0 commit comments