From ffa9de6b902b7f46a78a376120b29a1d3b93b293 Mon Sep 17 00:00:00 2001 From: Gabriela Trutan Date: Mon, 9 Dec 2024 13:24:08 +0100 Subject: [PATCH] SLVS-1377 Disconnect from sonarQube service on unbinding project --- .../Binding/UnintrusiveBindingControllerTests.cs | 3 ++- src/ConnectedMode/Binding/IUnintrusiveBindingController.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ConnectedMode.UnitTests/Binding/UnintrusiveBindingControllerTests.cs b/src/ConnectedMode.UnitTests/Binding/UnintrusiveBindingControllerTests.cs index c5bfa876b..2192a3228 100644 --- a/src/ConnectedMode.UnitTests/Binding/UnintrusiveBindingControllerTests.cs +++ b/src/ConnectedMode.UnitTests/Binding/UnintrusiveBindingControllerTests.cs @@ -117,7 +117,7 @@ public async Task BindAsync_CallsBindingProcessInOrder() } [TestMethod] - public void Unbind_BindingDeletionSucceeded_HandlesBindingChanges() + public void Unbind_BindingDeletionSucceeded_HandlesBindingChangesAndDisconnects() { solutionBindingRepository.DeleteBinding(AnyBoundProject.LocalBindingKey).Returns(true); @@ -126,6 +126,7 @@ public void Unbind_BindingDeletionSucceeded_HandlesBindingChanges() Received.InOrder(() => { solutionBindingRepository.DeleteBinding(AnyBoundProject.LocalBindingKey); + sonarQubeService.Disconnect(); activeSolutionChangedHandler.HandleBindingChange(true); }); } diff --git a/src/ConnectedMode/Binding/IUnintrusiveBindingController.cs b/src/ConnectedMode/Binding/IUnintrusiveBindingController.cs index 39b1ba97a..96d243289 100644 --- a/src/ConnectedMode/Binding/IUnintrusiveBindingController.cs +++ b/src/ConnectedMode/Binding/IUnintrusiveBindingController.cs @@ -75,6 +75,7 @@ public bool Unbind(string localBindingKey) var bindingDeleted = solutionBindingRepository.DeleteBinding(localBindingKey); if (bindingDeleted) { + sonarQubeService.Disconnect(); activeSolutionChangedHandler.HandleBindingChange(true); } return bindingDeleted;