Skip to content

Commit e14d57d

Browse files
committed
fix test code
Signed-off-by: May Zhang <[email protected]>
1 parent d634bed commit e14d57d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pkg/controller/controller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func (c *notificationController) processQueueItem() (processNext bool) {
320320
if c.factorySupport {
321321
apisWithNamespace, err := c.apiFactory.GetAPIsFromFactory(resource)
322322
if err != nil {
323-
logEntry.Errorf("Failed to get api with namespace: %v", err)
323+
logEntry.Errorf("Failed to get api with key: %v", err)
324324
eventSequence.addError(err)
325325
}
326326
for _, api := range apisWithNamespace {

pkg/mocks/factory.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package mocks
22

3-
import "github.com/argoproj/notifications-engine/pkg/api"
3+
import (
4+
"fmt"
5+
"github.com/argoproj/notifications-engine/pkg/api"
6+
)
47

58
type FakeFactory struct {
69
Api api.API
@@ -16,3 +19,7 @@ func (f *FakeFactory) GetAPIsFromNamespace(namespace string) (map[string]api.API
1619
apiMap[namespace] = f.Api
1720
return apiMap, f.Err
1821
}
22+
23+
func (f *FakeFactory) GetAPIsFromFactory(resource interface{}) (map[string]api.API, error) {
24+
return nil, fmt.Errorf("not implemented")
25+
}

0 commit comments

Comments
 (0)