diff --git a/go.mod b/go.mod index 34ca4b7..5c474f8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/edgexfoundry/go-mod-registry/v2 +module github.com/edgexfoundry/go-mod-registry/v3 go 1.18 diff --git a/internal/pkg/consul/client.go b/internal/pkg/consul/client.go index 5f789a1..f7dcc48 100644 --- a/internal/pkg/consul/client.go +++ b/internal/pkg/consul/client.go @@ -24,7 +24,7 @@ import ( consulapi "github.com/hashicorp/consul/api" - "github.com/edgexfoundry/go-mod-registry/v2/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" ) const ( @@ -225,7 +225,7 @@ func (client *consulClient) GetServiceEndpoint(serviceID string) (types.ServiceE return endpoint, nil } -//GetAllServiceEndpoints retrieves all registered endpoints from Consul. +// GetAllServiceEndpoints retrieves all registered endpoints from Consul. func (client *consulClient) GetAllServiceEndpoints() ([]types.ServiceEndpoint, error) { services, err := client.consulClient.Agent().Services() diff --git a/internal/pkg/consul/client_test.go b/internal/pkg/consul/client_test.go index 8f70bdc..ea6e1b0 100644 --- a/internal/pkg/consul/client_test.go +++ b/internal/pkg/consul/client_test.go @@ -30,7 +30,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/edgexfoundry/go-mod-registry/v2/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" ) const ( diff --git a/registry/factory.go b/registry/factory.go index 2f2252b..ab74b1c 100644 --- a/registry/factory.go +++ b/registry/factory.go @@ -19,8 +19,8 @@ package registry import ( "fmt" - "github.com/edgexfoundry/go-mod-registry/v2/internal/pkg/consul" - "github.com/edgexfoundry/go-mod-registry/v2/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v3/internal/pkg/consul" + "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" ) func NewRegistryClient(registryConfig types.Config) (Client, error) { diff --git a/registry/factory_test.go b/registry/factory_test.go index 99e9250..af37349 100644 --- a/registry/factory_test.go +++ b/registry/factory_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/edgexfoundry/go-mod-registry/v2/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" ) var registryConfig = types.Config{ diff --git a/registry/interface.go b/registry/interface.go index b9d222a..57b4bfa 100644 --- a/registry/interface.go +++ b/registry/interface.go @@ -17,7 +17,7 @@ package registry import ( - "github.com/edgexfoundry/go-mod-registry/v2/pkg/types" + "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" ) type Client interface { diff --git a/registry/mocks/Client.go b/registry/mocks/Client.go index 1f48adb..29f8f0a 100644 --- a/registry/mocks/Client.go +++ b/registry/mocks/Client.go @@ -1,11 +1,11 @@ -// Code generated by mockery v2.3.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks import ( mock "github.com/stretchr/testify/mock" - types "github.com/edgexfoundry/go-mod-registry/v2/pkg/types" + types "github.com/edgexfoundry/go-mod-registry/v3/pkg/types" ) // Client is an autogenerated mock type for the Client type @@ -133,3 +133,18 @@ func (_m *Client) Unregister() error { return r0 } + +type mockConstructorTestingTNewClient interface { + mock.TestingT + Cleanup(func()) +} + +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewClient(t mockConstructorTestingTNewClient) *Client { + mock := &Client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}