@@ -21,12 +21,12 @@ import (
2121
2222type TestCase struct {
2323 name string
24- val gnmiext.Configurable
24+ val gnmiext.DataElement
2525}
2626
2727var tests []TestCase
2828
29- func Register (name string , val gnmiext.Configurable ) {
29+ func Register (name string , val gnmiext.DataElement ) {
3030 tests = append (tests , TestCase {
3131 name : name ,
3232 val : val ,
@@ -92,11 +92,11 @@ func Test_Payload(t *testing.T) {
9292type MockClient struct {
9393 // Function fields for mocking different methods
9494 CapabilitiesFunc func () * gnmiext.Capabilities
95- GetConfigFunc func (ctx context.Context , conf ... gnmiext.Configurable ) error
96- PatchFunc func (ctx context.Context , conf ... gnmiext.Configurable ) error
97- UpdateFunc func (ctx context.Context , conf ... gnmiext.Configurable ) error
98- DeleteFunc func (ctx context.Context , conf ... gnmiext.Configurable ) error
99- GetStateFunc func (ctx context.Context , conf ... gnmiext.Configurable ) error
95+ GetConfigFunc func (ctx context.Context , configs ... gnmiext.DataElement ) error
96+ PatchFunc func (ctx context.Context , patches ... gnmiext.DataElement ) error
97+ UpdateFunc func (ctx context.Context , updates ... gnmiext.DataElement ) error
98+ DeleteFunc func (ctx context.Context , deletes ... gnmiext.DataElement ) error
99+ GetStateFunc func (ctx context.Context , states ... gnmiext.DataElement ) error
100100}
101101
102102var _ gnmiext.Client = (* MockClient )(nil )
@@ -109,37 +109,37 @@ func (m *MockClient) Capabilities() *gnmiext.Capabilities {
109109 return nil
110110}
111111
112- func (m * MockClient ) GetConfig (ctx context.Context , conf ... gnmiext.Configurable ) error {
112+ func (m * MockClient ) GetConfig (ctx context.Context , configs ... gnmiext.DataElement ) error {
113113 if m .GetConfigFunc != nil {
114- return m .GetConfigFunc (ctx , conf ... )
114+ return m .GetConfigFunc (ctx , configs ... )
115115 }
116116 return nil
117117}
118118
119- func (m * MockClient ) GetState (ctx context.Context , conf ... gnmiext.Configurable ) error {
119+ func (m * MockClient ) GetState (ctx context.Context , states ... gnmiext.DataElement ) error {
120120 if m .GetStateFunc != nil {
121- return m .GetStateFunc (ctx , conf ... )
121+ return m .GetStateFunc (ctx , states ... )
122122 }
123123 return nil
124124}
125125
126- func (m * MockClient ) Patch (ctx context.Context , conf ... gnmiext.Configurable ) error {
126+ func (m * MockClient ) Patch (ctx context.Context , patches ... gnmiext.DataElement ) error {
127127 if m .PatchFunc != nil {
128- return m .PatchFunc (ctx , conf ... )
128+ return m .PatchFunc (ctx , patches ... )
129129 }
130130 return nil
131131}
132132
133- func (m * MockClient ) Update (ctx context.Context , conf ... gnmiext.Configurable ) error {
133+ func (m * MockClient ) Update (ctx context.Context , updates ... gnmiext.DataElement ) error {
134134 if m .UpdateFunc != nil {
135- return m .UpdateFunc (ctx , conf ... )
135+ return m .UpdateFunc (ctx , updates ... )
136136 }
137137 return nil
138138}
139139
140- func (m * MockClient ) Delete (ctx context.Context , conf ... gnmiext.Configurable ) error {
140+ func (m * MockClient ) Delete (ctx context.Context , deletes ... gnmiext.DataElement ) error {
141141 if m .DeleteFunc != nil {
142- return m .DeleteFunc (ctx , conf ... )
142+ return m .DeleteFunc (ctx , deletes ... )
143143 }
144144 return nil
145145}
@@ -187,8 +187,8 @@ func Test_EnsureInterface(t *testing.T) {
187187
188188func Test_GetState (t * testing.T ) {
189189 m := & MockClient {
190- GetStateFunc : func (ctx context.Context , conf ... gnmiext.Configurable ) error {
191- conf [0 ].(* PhysIfState ).State = "im-state-up"
190+ GetStateFunc : func (ctx context.Context , states ... gnmiext.DataElement ) error {
191+ states [0 ].(* PhysIfState ).State = "im-state-up"
192192 return nil
193193 },
194194 }
0 commit comments