"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"oransc.org/usecase/oruclosedloop/internal/repository"
- "oransc.org/usecase/oruclosedloop/internal/restclient"
"oransc.org/usecase/oruclosedloop/internal/ves"
"oransc.org/usecase/oruclosedloop/mocks"
)
StatusCode: http.StatusOK,
}, nil)
- restclient.Client = &clientMock
-
lookupServiceMock := mocks.LookupService{}
lookupServiceMock.On("GetODuID", mock.Anything).Return("HCL-O-DU-1122", nil)
SDNRAddress: "http://localhost:9990",
SDNRUser: "admin",
SDNRPassword: "pwd",
- })
+ }, &clientMock)
responseRecorder := httptest.NewRecorder()
r := newRequest(http.MethodPost, "/", getFaultMessage("ERICSSON-O-RU-11220", "CRITICAL"), t)
lookupServiceMock.On("GetODuID", mock.Anything).Return("HCL-O-DU-1122", nil)
- handlerUnderTest := NewLinkFailureHandler(&lookupServiceMock, Configuration{})
+ handlerUnderTest := NewLinkFailureHandler(&lookupServiceMock, Configuration{}, nil)
responseRecorder := httptest.NewRecorder()
r := newRequest(http.MethodPost, "/", getFaultMessage("ERICSSON-O-RU-11220", "NORMAL"), t)
Id: "ERICSSON-O-RU-11220",
})
- handlerUnderTest := NewLinkFailureHandler(&lookupServiceMock, Configuration{})
+ handlerUnderTest := NewLinkFailureHandler(&lookupServiceMock, Configuration{}, nil)
responseRecorder := httptest.NewRecorder()
r := newRequest(http.MethodPost, "/", getFaultMessage("ERICSSON-O-RU-11220", "CRITICAL"), t)