Skip to content
Snippets Groups Projects
Commit 113cbac5 authored by Malte Bauch's avatar Malte Bauch
Browse files

refactoring for initialism linting errors

parent d84da56a
No related branches found
No related tags found
2 merge requests!120Resolve "Code Quality",!90Develop
...@@ -114,7 +114,7 @@ func (_m *PrincipalNetworkDomain) GetSBIs() interface{} { ...@@ -114,7 +114,7 @@ func (_m *PrincipalNetworkDomain) GetSBIs() interface{} {
} }
// Id provides a mock function with given fields: // Id provides a mock function with given fields:
func (_m *PrincipalNetworkDomain) Id() uuid.UUID { func (_m *PrincipalNetworkDomain) ID() uuid.UUID {
ret := _m.Called() ret := _m.Called()
var r0 uuid.UUID var r0 uuid.UUID
......
...@@ -19,7 +19,7 @@ type SouthboundInterface struct { ...@@ -19,7 +19,7 @@ type SouthboundInterface struct {
} }
// Id provides a mock function with given fields: // Id provides a mock function with given fields:
func (_m *SouthboundInterface) Id() uuid.UUID { func (_m *SouthboundInterface) ID() uuid.UUID {
ret := _m.Called() ret := _m.Called()
var r0 uuid.UUID var r0 uuid.UUID
......
...@@ -14,7 +14,7 @@ type Storable struct { ...@@ -14,7 +14,7 @@ type Storable struct {
} }
// Id provides a mock function with given fields: // Id provides a mock function with given fields:
func (_m *Storable) Id() uuid.UUID { func (_m *Storable) ID() uuid.UUID {
ret := _m.Called() ret := _m.Called()
var r0 uuid.UUID var r0 uuid.UUID
......
...@@ -38,7 +38,7 @@ func initialize() error { ...@@ -38,7 +38,7 @@ func initialize() error {
} }
// TODO: Start grpc listener here // TODO: Start grpc listener here
if err := httpApi(); err != nil { if err := httpAPI(); err != nil {
return err return err
} }
......
...@@ -8,8 +8,8 @@ import ( ...@@ -8,8 +8,8 @@ import (
// Device represents an Orchestrated Network Device (OND) which is managed by // Device represents an Orchestrated Network Device (OND) which is managed by
// nucleus // nucleus
type Device struct { type Device struct {
// Uuid represents the Devices UUID // UUID represents the Devices UUID
Uuid uuid.UUID UUID uuid.UUID
// Device inherits properties of ygot.GoStruct // Device inherits properties of ygot.GoStruct
ygot.GoStruct ygot.GoStruct
...@@ -36,14 +36,14 @@ func NewDevice(sbi SouthboundInterface, opts TransportOptions) (*Device, error) ...@@ -36,14 +36,14 @@ func NewDevice(sbi SouthboundInterface, opts TransportOptions) (*Device, error)
} }
return &Device{ return &Device{
Uuid: uuid.New(), UUID: uuid.New(),
GoStruct: sbi.Schema().Root, GoStruct: sbi.Schema().Root,
SBI: sbi, SBI: sbi,
Transport: transport, Transport: transport,
}, nil }, nil
} }
// Id returns the uuid of the Device // ID returns the UUID of the Device
func (d *Device) Id() uuid.UUID { func (d *Device) ID() uuid.UUID {
return d.Uuid return d.UUID
} }
...@@ -14,7 +14,7 @@ func TestDevice_Id(t *testing.T) { ...@@ -14,7 +14,7 @@ func TestDevice_Id(t *testing.T) {
GoStruct ygot.GoStruct GoStruct ygot.GoStruct
SBI SouthboundInterface SBI SouthboundInterface
Transport Transport Transport Transport
Uuid uuid.UUID UUID uuid.UUID
} }
tests := []struct { tests := []struct {
name string name string
...@@ -24,7 +24,7 @@ func TestDevice_Id(t *testing.T) { ...@@ -24,7 +24,7 @@ func TestDevice_Id(t *testing.T) {
{ {
name: "default", name: "default",
fields: fields{ fields: fields{
Uuid: did, UUID: did,
}, },
want: did, want: did,
}, },
...@@ -35,10 +35,10 @@ func TestDevice_Id(t *testing.T) { ...@@ -35,10 +35,10 @@ func TestDevice_Id(t *testing.T) {
GoStruct: tt.fields.GoStruct, GoStruct: tt.fields.GoStruct,
SBI: tt.fields.SBI, SBI: tt.fields.SBI,
Transport: tt.fields.Transport, Transport: tt.fields.Transport,
Uuid: tt.fields.Uuid, UUID: tt.fields.UUID,
} }
if got := d.Id(); !reflect.DeepEqual(got, tt.want) { if got := d.ID(); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Id() = %v, want %v", got, tt.want) t.Errorf("ID() = %v, want %v", got, tt.want)
} }
}) })
} }
...@@ -71,7 +71,7 @@ func TestNewDevice(t *testing.T) { ...@@ -71,7 +71,7 @@ func TestNewDevice(t *testing.T) {
want: &Device{ want: &Device{
GoStruct: &openconfig.Device{}, GoStruct: &openconfig.Device{},
SBI: sbi, SBI: sbi,
Uuid: uuid.New(), UUID: uuid.New(),
Transport: &Gnmi{ Transport: &Gnmi{
Options: &GnmiTransportOptions{ Options: &GnmiTransportOptions{
Config: gnmi.Config{ Config: gnmi.Config{
...@@ -91,7 +91,7 @@ func TestNewDevice(t *testing.T) { ...@@ -91,7 +91,7 @@ func TestNewDevice(t *testing.T) {
t.Error(err) t.Error(err)
} }
tt.want.Transport.(*Gnmi).client = got.Transport.(*Gnmi).client tt.want.Transport.(*Gnmi).client = got.Transport.(*Gnmi).client
tt.want.Uuid = got.Id() tt.want.UUID = got.ID()
if (err != nil) != tt.wantErr { if (err != nil) != tt.wantErr {
t.Errorf("NewDevice() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("NewDevice() error = %v, wantErr %v", err, tt.wantErr)
return return
......
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
const basePath = "/api" const basePath = "/api"
// deprecated // deprecated
func httpApi() (err error) { func httpAPI() (err error) {
http.HandleFunc(basePath, httpHandler) http.HandleFunc(basePath, httpHandler)
http.HandleFunc("/livez", healthCheck) http.HandleFunc("/livez", healthCheck)
http.HandleFunc("/readyz", healthCheck) http.HandleFunc("/readyz", healthCheck)
...@@ -89,7 +89,7 @@ func httpHandler(writer http.ResponseWriter, request *http.Request) { ...@@ -89,7 +89,7 @@ func httpHandler(writer http.ResponseWriter, request *http.Request) {
} }
writer.WriteHeader(http.StatusCreated) writer.WriteHeader(http.StatusCreated)
fmt.Fprintf(writer, "device added\n") fmt.Fprintf(writer, "device added\n")
fmt.Fprintf(writer, "UUID: %v\n", d.Uuid) fmt.Fprintf(writer, "UUID: %v\n", d.UUID)
case "request": case "request":
err = pnd.Request(id, query.Get("path")) err = pnd.Request(id, query.Get("path"))
if err != nil { if err != nil {
......
...@@ -18,8 +18,8 @@ func Test_httpApi(t *testing.T) { ...@@ -18,8 +18,8 @@ func Test_httpApi(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
if err := httpApi(tt.args.ctx); (err != nil) != tt.wantErr { if err := httpAPI(); (err != nil) != tt.wantErr {
t.Errorf("httpApi() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("httpAPI() error = %v, wantErr %v", err, tt.wantErr)
} }
}) })
} }
......
...@@ -24,7 +24,7 @@ type PrincipalNetworkDomain interface { ...@@ -24,7 +24,7 @@ type PrincipalNetworkDomain interface {
MarshalDevice(uuid.UUID) (string, error) MarshalDevice(uuid.UUID) (string, error)
ContainsDevice(uuid.UUID) bool ContainsDevice(uuid.UUID) bool
GetSBIs() interface{} GetSBIs() interface{}
Id() uuid.UUID ID() uuid.UUID
} }
type pndImplementation struct { type pndImplementation struct {
...@@ -50,7 +50,7 @@ func NewPND(name, description string, id uuid.UUID, sbi SouthboundInterface) (Pr ...@@ -50,7 +50,7 @@ func NewPND(name, description string, id uuid.UUID, sbi SouthboundInterface) (Pr
return pnd, nil return pnd, nil
} }
func (pnd *pndImplementation) Id() uuid.UUID { func (pnd *pndImplementation) ID() uuid.UUID {
return pnd.id return pnd.id
} }
......
...@@ -23,12 +23,12 @@ func testSetupPnd() { ...@@ -23,12 +23,12 @@ func testSetupPnd() {
log.Fatal(err) log.Fatal(err)
} }
defaultSbiId, err = uuid.Parse("b70c8425-68c7-4d4b-bb5e-5586572bd64b") defaultSbiID, err = uuid.Parse("b70c8425-68c7-4d4b-bb5e-5586572bd64b")
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
defaultPndId, err = uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad") defaultPndID, err = uuid.Parse("b4016412-eec5-45a1-aa29-f59915357bad")
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
...@@ -36,7 +36,7 @@ func testSetupPnd() { ...@@ -36,7 +36,7 @@ func testSetupPnd() {
func mockDevice() Device { func mockDevice() Device {
return Device{ return Device{
Uuid: mdid, UUID: mdid,
GoStruct: nil, GoStruct: nil,
SBI: &OpenConfig{}, SBI: &OpenConfig{},
Transport: &mocks.Transport{}, Transport: &mocks.Transport{},
...@@ -49,18 +49,18 @@ func newPnd() pndImplementation { ...@@ -49,18 +49,18 @@ func newPnd() pndImplementation {
description: "default test pnd", description: "default test pnd",
sbic: sbiStore{store{}}, sbic: sbiStore{store{}},
devices: deviceStore{store{}}, devices: deviceStore{store{}},
id: defaultPndId, id: defaultPndID,
} }
} }
var did uuid.UUID var did uuid.UUID
var mdid uuid.UUID var mdid uuid.UUID
var defaultSbiId uuid.UUID var defaultSbiID uuid.UUID
var defaultPndId uuid.UUID var defaultPndID uuid.UUID
func TestNewPND(t *testing.T) { func TestNewPND(t *testing.T) {
pnd := newPnd() pnd := newPnd()
if err := pnd.addSbi(&OpenConfig{id: defaultSbiId}); err != nil { if err := pnd.addSbi(&OpenConfig{id: defaultSbiID}); err != nil {
t.Error(err) t.Error(err)
} }
type args struct { type args struct {
...@@ -80,8 +80,8 @@ func TestNewPND(t *testing.T) { ...@@ -80,8 +80,8 @@ func TestNewPND(t *testing.T) {
args: args{ args: args{
name: "default", name: "default",
description: "default test pnd", description: "default test pnd",
sbi: &OpenConfig{id: defaultSbiId}, sbi: &OpenConfig{id: defaultSbiID},
pid: defaultPndId, pid: defaultPndID,
}, },
want: &pnd, want: &pnd,
wantErr: false, wantErr: false,
...@@ -130,7 +130,7 @@ func Test_pndImplementation_AddDevice(t *testing.T) { ...@@ -130,7 +130,7 @@ func Test_pndImplementation_AddDevice(t *testing.T) {
name: "default", name: "default",
args: args{ args: args{
device: &Device{ device: &Device{
Uuid: did, UUID: did,
}, },
}, },
wantErr: false, wantErr: false,
...@@ -139,7 +139,7 @@ func Test_pndImplementation_AddDevice(t *testing.T) { ...@@ -139,7 +139,7 @@ func Test_pndImplementation_AddDevice(t *testing.T) {
name: "already exists", name: "already exists",
args: args{ args: args{
device: &Device{ device: &Device{
Uuid: did, UUID: did,
}, },
}, },
wantErr: true, wantErr: true,
...@@ -156,7 +156,7 @@ func Test_pndImplementation_AddDevice(t *testing.T) { ...@@ -156,7 +156,7 @@ func Test_pndImplementation_AddDevice(t *testing.T) {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
pnd := newPnd() pnd := newPnd()
if tt.name == "already exists" { if tt.name == "already exists" {
pnd.devices.store[did] = &Device{Uuid: did} pnd.devices.store[did] = &Device{UUID: did}
} }
err := pnd.AddDevice(tt.args.device) err := pnd.AddDevice(tt.args.device)
if (err != nil) != tt.wantErr { if (err != nil) != tt.wantErr {
...@@ -191,7 +191,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) { ...@@ -191,7 +191,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) {
name: "default", name: "default",
args: args{ args: args{
sbi: &OpenConfig{ sbi: &OpenConfig{
id: defaultSbiId, id: defaultSbiID,
}, },
}, },
wantErr: false, wantErr: false,
...@@ -200,7 +200,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) { ...@@ -200,7 +200,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) {
name: "already exists", name: "already exists",
args: args{ args: args{
sbi: &OpenConfig{ sbi: &OpenConfig{
id: defaultSbiId, id: defaultSbiID,
}, },
}, },
wantErr: true, wantErr: true,
...@@ -209,7 +209,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) { ...@@ -209,7 +209,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) {
name: "fails wrong type", name: "fails wrong type",
args: args{ args: args{
sbi: &pndImplementation{ sbi: &pndImplementation{
id: defaultSbiId, id: defaultSbiID,
}, },
}, },
wantErr: true, wantErr: true,
...@@ -219,7 +219,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) { ...@@ -219,7 +219,7 @@ func Test_pndImplementation_AddSbi(t *testing.T) {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
pnd := newPnd() pnd := newPnd()
if tt.name == "already exists" { if tt.name == "already exists" {
pnd.sbic.store[defaultSbiId] = tt.args.sbi.(*OpenConfig) pnd.sbic.store[defaultSbiID] = tt.args.sbi.(*OpenConfig)
} }
err := pnd.AddSbi(tt.args.sbi) err := pnd.AddSbi(tt.args.sbi)
if (err != nil) != tt.wantErr { if (err != nil) != tt.wantErr {
...@@ -227,12 +227,12 @@ func Test_pndImplementation_AddSbi(t *testing.T) { ...@@ -227,12 +227,12 @@ func Test_pndImplementation_AddSbi(t *testing.T) {
} }
if tt.name != "fails wrong type" { if tt.name != "fails wrong type" {
if err == nil { if err == nil {
_, ok := pnd.sbic.store[defaultSbiId] _, ok := pnd.sbic.store[defaultSbiID]
if !ok { if !ok {
t.Errorf("AddSbi() SBI %v not in device store %v", t.Errorf("AddSbi() SBI %v not in device store %v",
tt.args.sbi, pnd.GetSBIs()) tt.args.sbi, pnd.GetSBIs())
} }
if err := pnd.sbic.delete(defaultSbiId); err != nil { if err := pnd.sbic.delete(defaultSbiID); err != nil {
t.Error(err) t.Error(err)
} }
} }
...@@ -253,15 +253,15 @@ func Test_pndImplementation_ContainsDevice(t *testing.T) { ...@@ -253,15 +253,15 @@ func Test_pndImplementation_ContainsDevice(t *testing.T) {
}{ }{
{name: "default", args: args{ {name: "default", args: args{
uuid: did, uuid: did,
device: &Device{Uuid: did}, device: &Device{UUID: did},
}, want: true}, }, want: true},
{name: "fails", args: args{ {name: "fails", args: args{
uuid: uuid.New(), uuid: uuid.New(),
device: &Device{Uuid: did}, device: &Device{UUID: did},
}, want: false}, }, want: false},
{name: "fails empty", args: args{ {name: "fails empty", args: args{
uuid: uuid.New(), uuid: uuid.New(),
device: &Device{Uuid: did}, device: &Device{UUID: did},
}, want: false}, }, want: false},
} }
for _, tt := range tests { for _, tt := range tests {
...@@ -383,7 +383,7 @@ func Test_pndImplementation_MarshalDevice(t *testing.T) { ...@@ -383,7 +383,7 @@ func Test_pndImplementation_MarshalDevice(t *testing.T) {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
pnd := newPnd() pnd := newPnd()
d := &Device{ d := &Device{
Uuid: tt.args.uuid, UUID: tt.args.uuid,
GoStruct: &openconfig.Device{}, GoStruct: &openconfig.Device{},
SBI: nil, SBI: nil,
Transport: nil, Transport: nil,
...@@ -423,7 +423,7 @@ func Test_pndImplementation_RemoveDevice(t *testing.T) { ...@@ -423,7 +423,7 @@ func Test_pndImplementation_RemoveDevice(t *testing.T) {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
pnd := newPnd() pnd := newPnd()
if tt.name != "fails empty" { if tt.name != "fails empty" {
d := &Device{Uuid: did} d := &Device{UUID: did}
if err := pnd.addDevice(d); err != nil { if err := pnd.addDevice(d); err != nil {
t.Error(err) t.Error(err)
} }
...@@ -447,9 +447,9 @@ func Test_pndImplementation_RemoveSbi(t *testing.T) { ...@@ -447,9 +447,9 @@ func Test_pndImplementation_RemoveSbi(t *testing.T) {
args args args args
wantErr bool wantErr bool
}{ }{
{name: "default", args: args{id: defaultSbiId}, wantErr: false}, {name: "default", args: args{id: defaultSbiID}, wantErr: false},
{name: "fails", args: args{id: uuid.New()}, wantErr: true}, {name: "fails", args: args{id: uuid.New()}, wantErr: true},
{name: "fails empty", args: args{id: defaultSbiId}, wantErr: true}, {name: "fails empty", args: args{id: defaultSbiID}, wantErr: true},
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
...@@ -458,10 +458,10 @@ func Test_pndImplementation_RemoveSbi(t *testing.T) { ...@@ -458,10 +458,10 @@ func Test_pndImplementation_RemoveSbi(t *testing.T) {
description: "test-remove-sbi", description: "test-remove-sbi",
sbic: sbiStore{store{}}, sbic: sbiStore{store{}},
devices: deviceStore{store{}}, devices: deviceStore{store{}},
id: defaultPndId, id: defaultPndID,
} }
if tt.name != "fails empty" { if tt.name != "fails empty" {
if err := pnd.addSbi(&OpenConfig{id: defaultSbiId}); err != nil { if err := pnd.addSbi(&OpenConfig{id: defaultSbiID}); err != nil {
t.Error(err) t.Error(err)
} }
} }
......
...@@ -23,7 +23,7 @@ type SouthboundInterface interface { ...@@ -23,7 +23,7 @@ type SouthboundInterface interface {
// Needed for type assertion. // Needed for type assertion.
SetNode() func(schema *yang.Entry, root interface{}, path *gpb.Path, val interface{}, opts ...ytypes.SetNodeOpt) error SetNode() func(schema *yang.Entry, root interface{}, path *gpb.Path, val interface{}, opts ...ytypes.SetNodeOpt) error
Schema() *ytypes.Schema Schema() *ytypes.Schema
Id() uuid.UUID ID() uuid.UUID
} }
// Tapi is the implementation of an TAPI SBI. // Tapi is the implementation of an TAPI SBI.
...@@ -147,7 +147,7 @@ func iter(a ygot.GoStruct, fields []string) (b ygot.GoStruct, f string, err erro ...@@ -147,7 +147,7 @@ func iter(a ygot.GoStruct, fields []string) (b ygot.GoStruct, f string, err erro
return return
} }
// Id returns the Id of the OpenConfig SBI // ID returns the ID of the OpenConfig SBI
func (oc *OpenConfig) Id() uuid.UUID { func (oc *OpenConfig) ID() uuid.UUID {
return oc.id return oc.id
} }
...@@ -47,8 +47,8 @@ func TestOpenConfig_Id(t *testing.T) { ...@@ -47,8 +47,8 @@ func TestOpenConfig_Id(t *testing.T) {
schema: tt.fields.schema, schema: tt.fields.schema,
id: tt.fields.id, id: tt.fields.id,
} }
if got := oc.Id(); !reflect.DeepEqual(got, tt.want) { if got := oc.ID(); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Id() = %v, want %v", got, tt.want) t.Errorf("ID() = %v, want %v", got, tt.want)
} }
}) })
} }
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
// Storable provides an interface for the controller's storage architecture. // Storable provides an interface for the controller's storage architecture.
type Storable interface { type Storable interface {
Id() uuid.UUID ID() uuid.UUID
} }
type store map[uuid.UUID]Storable type store map[uuid.UUID]Storable
...@@ -19,13 +19,13 @@ func (s store) exists(id uuid.UUID) bool { ...@@ -19,13 +19,13 @@ func (s store) exists(id uuid.UUID) bool {
} }
func (s store) add(item Storable) error { func (s store) add(item Storable) error {
if s.exists(item.Id()) { if s.exists(item.ID()) {
return &ErrAlreadyExists{item: item} return &ErrAlreadyExists{item: item}
} }
s[item.Id()] = item s[item.ID()] = item
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"type": reflect.TypeOf(item), "type": reflect.TypeOf(item),
"uuid": item.Id(), "uuid": item.ID(),
}).Info("storable was added") }).Info("storable was added")
return nil return nil
} }
......
...@@ -51,7 +51,7 @@ func Test_store_add(t *testing.T) { ...@@ -51,7 +51,7 @@ func Test_store_add(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
tt.args.item.(*mocks.Storable).On("Id").Return(iid) tt.args.item.(*mocks.Storable).On("ID").Return(iid)
switch tt.name { switch tt.name {
case "already exixts": case "already exixts":
_ = tt.s.add(tt.args.item) _ = tt.s.add(tt.args.item)
...@@ -254,18 +254,18 @@ func Test_sbiStore_get(t *testing.T) { ...@@ -254,18 +254,18 @@ func Test_sbiStore_get(t *testing.T) {
name: "exists", name: "exists",
fields: fields{ fields: fields{
store: store{ store: store{
defaultSbiId: &OpenConfig{id: defaultSbiId}, defaultSbiID: &OpenConfig{id: defaultSbiID},
}, },
}, },
args: args{id: defaultSbiId}, args: args{id: defaultSbiID},
want: &OpenConfig{id: defaultSbiId}, want: &OpenConfig{id: defaultSbiID},
wantErr: false, wantErr: false,
}, },
{ {
name: "fails", name: "fails",
fields: fields{ fields: fields{
store: store{ store: store{
defaultSbiId: &OpenConfig{id: defaultSbiId}, defaultSbiID: &OpenConfig{id: defaultSbiID},
}, },
}, },
args: args{id: iid}, args: args{id: iid},
...@@ -276,7 +276,7 @@ func Test_sbiStore_get(t *testing.T) { ...@@ -276,7 +276,7 @@ func Test_sbiStore_get(t *testing.T) {
fields: fields{ fields: fields{
store: store{}, store: store{},
}, },
args: args{id: defaultSbiId}, args: args{id: defaultSbiID},
wantErr: true, wantErr: true,
}, },
{ {
...@@ -284,7 +284,7 @@ func Test_sbiStore_get(t *testing.T) { ...@@ -284,7 +284,7 @@ func Test_sbiStore_get(t *testing.T) {
fields: fields{ fields: fields{
store: store{ store: store{
did: &Device{ did: &Device{
Uuid: did, UUID: did,
}, },
}, },
}, },
...@@ -327,18 +327,18 @@ func Test_pndStore_get(t *testing.T) { ...@@ -327,18 +327,18 @@ func Test_pndStore_get(t *testing.T) {
name: "exists", name: "exists",
fields: fields{ fields: fields{
store: store{ store: store{
defaultPndId: &pndImplementation{id: defaultPndId}, defaultPndID: &pndImplementation{id: defaultPndID},
}, },
}, },
args: args{id: defaultPndId}, args: args{id: defaultPndID},
want: &pndImplementation{id: defaultPndId}, want: &pndImplementation{id: defaultPndID},
wantErr: false, wantErr: false,
}, },
{ {
name: "fails", name: "fails",
fields: fields{ fields: fields{
store: store{ store: store{
defaultPndId: &pndImplementation{id: defaultPndId}, defaultPndID: &pndImplementation{id: defaultPndID},
}, },
}, },
args: args{id: iid}, args: args{id: iid},
...@@ -349,7 +349,7 @@ func Test_pndStore_get(t *testing.T) { ...@@ -349,7 +349,7 @@ func Test_pndStore_get(t *testing.T) {
fields: fields{ fields: fields{
store: store{}, store: store{},
}, },
args: args{id: defaultPndId}, args: args{id: defaultPndID},
wantErr: true, wantErr: true,
}, },
{ {
...@@ -357,7 +357,7 @@ func Test_pndStore_get(t *testing.T) { ...@@ -357,7 +357,7 @@ func Test_pndStore_get(t *testing.T) {
fields: fields{ fields: fields{
store: store{ store: store{
did: &Device{ did: &Device{
Uuid: did, UUID: did,
}, },
}, },
}, },
...@@ -400,10 +400,10 @@ func Test_deviceStore_get(t *testing.T) { ...@@ -400,10 +400,10 @@ func Test_deviceStore_get(t *testing.T) {
name: "exists", name: "exists",
fields: fields{ fields: fields{
store: store{ store: store{
defaultPndId: &Device{Uuid: did}}}, defaultPndID: &Device{UUID: did}}},
args: args{id: defaultPndId}, args: args{id: defaultPndID},
want: &Device{ want: &Device{
Uuid: did, UUID: did,
}, },
wantErr: false, wantErr: false,
}, },
...@@ -411,7 +411,7 @@ func Test_deviceStore_get(t *testing.T) { ...@@ -411,7 +411,7 @@ func Test_deviceStore_get(t *testing.T) {
name: "fails", name: "fails",
fields: fields{ fields: fields{
store: store{ store: store{
defaultPndId: &Device{Uuid: did}}}, defaultPndID: &Device{UUID: did}}},
args: args{id: iid}, args: args{id: iid},
wantErr: true, wantErr: true,
}, },
...@@ -420,15 +420,15 @@ func Test_deviceStore_get(t *testing.T) { ...@@ -420,15 +420,15 @@ func Test_deviceStore_get(t *testing.T) {
fields: fields{ fields: fields{
store: store{}, store: store{},
}, },
args: args{id: defaultPndId}, args: args{id: defaultPndID},
wantErr: true, wantErr: true,
}, },
{ {
name: "fails wrong type", name: "fails wrong type",
fields: fields{ fields: fields{
store: store{ store: store{
defaultPndId: &pndImplementation{id: defaultPndId}}}, defaultPndID: &pndImplementation{id: defaultPndID}}},
args: args{id: defaultPndId}, args: args{id: defaultPndID},
wantErr: true, wantErr: true,
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment