t.Errorf("#... - failed to initialize logger, error: %s", err)
}
- config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: maxAttempts}
+ config := &configuration.Configuration{RnibRetryIntervalMs: 10, MaxRnibConnectionAttempts: maxAttempts, RnibWriter: configuration.RnibWriterConfig{RanManipulationMessageChannel: "RAN_MANIPULATION", StateChangeMessageChannel: "RAN_CONNECTION_STATUS_CHANGE"}}
readerMock := &mocks.RnibReaderMock{}
assert.True(t, res)
}
+func TestSuccessfulUpdateNodebInfoOnConnectionStatusInversion(t *testing.T) {
+ rnibDataService, _, writerMock := setupRnibDataServiceTest(t)
+ event := "event"
+
+ nodebInfo := &entities.NodebInfo{}
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, "RAN_CONNECTION_STATUS_CHANGE", event).Return(nil)
+
+ rnibDataService.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event)
+ writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 1)
+}
+
+func TestConnFailureUpdateNodebInfoOnConnectionStatusInversion(t *testing.T) {
+ rnibDataService, _, writerMock := setupRnibDataServiceTest(t)
+ event := "event"
+
+ nodebInfo := &entities.NodebInfo{}
+ mockErr := &common.InternalError{Err: &net.OpError{Err: fmt.Errorf("connection error")}}
+ writerMock.On("UpdateNodebInfoOnConnectionStatusInversion", nodebInfo, "RAN_CONNECTION_STATUS_CHANGE", event).Return(mockErr)
+
+ rnibDataService.UpdateNodebInfoOnConnectionStatusInversion(nodebInfo, event)
+ writerMock.AssertNumberOfCalls(t, "UpdateNodebInfoOnConnectionStatusInversion", 3)
+}
+
//func TestConnFailureThenSuccessGetNodebIdList(t *testing.T) {
// rnibDataService, readerMock, _ := setupRnibDataServiceTest(t)
//