From 6e1017279d52911b0a6a2290675a6e730c96ba78 Mon Sep 17 00:00:00 2001
From: Fabian Seidl <fabian.seidl@h-da.de>
Date: Mon, 3 Jun 2024 12:48:04 +0200
Subject: [PATCH] fix return value in networkelementServiceMock, nolint in
 pluginServiceMock

---
 controller/nucleus/networkElementServiceMock.go | 5 +++--
 controller/nucleus/pluginServiceMock.go         | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/controller/nucleus/networkElementServiceMock.go b/controller/nucleus/networkElementServiceMock.go
index 4735109b8..78b9f60f4 100644
--- a/controller/nucleus/networkElementServiceMock.go
+++ b/controller/nucleus/networkElementServiceMock.go
@@ -1,6 +1,7 @@
 package nucleus
 
 import (
+	"code.fbi.h-da.de/danet/gosdn/controller/customerrs"
 	"code.fbi.h-da.de/danet/gosdn/controller/interfaces/networkelement"
 	"code.fbi.h-da.de/danet/gosdn/controller/store"
 	"github.com/google/uuid"
@@ -66,12 +67,12 @@ func (t *NetworkElementServiceMock) Get(query store.Query) (networkelement.Netwo
 		// Second search for name
 		id, ok := t.nameLookupTable[query.Name]
 		if !ok {
-			return nil, nil
+			return nil, customerrs.CouldNotFindError{Name: query.Name}
 		}
 
 		item, ok := t.Store[id]
 		if !ok {
-			return nil, nil
+			return nil, customerrs.CouldNotFindError{ID: id}
 		}
 
 		return item, nil
diff --git a/controller/nucleus/pluginServiceMock.go b/controller/nucleus/pluginServiceMock.go
index a580657fc..0cdfa6b8f 100644
--- a/controller/nucleus/pluginServiceMock.go
+++ b/controller/nucleus/pluginServiceMock.go
@@ -62,5 +62,5 @@ func (t *PluginServiceMock) GetAll() ([]plugin.Plugin, error) {
 // RequestPlugin is a mock for requesting a plugin from the registry.
 // TODO: add plugin mock here.
 func (t *PluginServiceMock) RequestPlugin(uuid.UUID) (plugin.Plugin, error) {
-	return nil, nil
+	return nil, nil //nolint:nilnil
 }
-- 
GitLab