+func TestExecuteSetupUnsupportedProtocol(t *testing.T) {
+ rmrMessengerMock, writerMock, mgr := initRanSetupManagerTest(t)
+
+ ranName := "test1"
+
+ var initialNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTED, E2ApplicationProtocol: entities.E2ApplicationProtocol_UNKNOWN_E2_APPLICATION_PROTOCOL}
+ var argNodeb = &entities.NodebInfo{ConnectionStatus: entities.ConnectionStatus_CONNECTING, E2ApplicationProtocol: entities.E2ApplicationProtocol_UNKNOWN_E2_APPLICATION_PROTOCOL, ConnectionAttempts: 1}
+ var rnibErr error
+ writerMock.On("UpdateNodebInfo", argNodeb).Return(rnibErr)
+
+ payload := e2pdus.PackedX2setupRequest
+ xaction := []byte(ranName)
+ msg := rmrCgo.NewMBuf(rmrCgo.RIC_X2_SETUP_REQ, len(payload), ranName, &payload, &xaction)
+ rmrMessengerMock.On("SendMsg", mock.Anything).Return(msg, nil)
+
+ if err := mgr.ExecuteSetup(initialNodeb, entities.ConnectionStatus_CONNECTING); err == nil {
+ t.Errorf("want: error, got: success")
+ }
+
+ writerMock.AssertNumberOfCalls(t, "UpdateNodebInfo", 1)
+ rmrMessengerMock.AssertNumberOfCalls(t, "SendMsg", 0)
+}