From f68dc0427394966d2909b6c2d335ebb267e0876b Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 21 Jan 2023 13:18:00 -0600 Subject: [PATCH] Fixed: RemotePathMappingCheck Improvements --- src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs | 2 +- .../HealthCheck/Checks/DownloadClientCheckFixture.cs | 6 +++--- .../Checks/DownloadClientRootFolderCheckFixture.cs | 2 +- .../HealthCheck/Checks/RemotePathMappingCheckFixture.cs | 2 +- .../HealthCheck/Checks/RemotePathMappingCheck.cs | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs index c1ba20ce1..c2504888f 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadServiceFixture.cs @@ -27,7 +27,7 @@ public void Setup() _downloadClients = new List(); Mocker.GetMock() - .Setup(v => v.GetDownloadClients()) + .Setup(v => v.GetDownloadClients(It.IsAny())) .Returns(_downloadClients); Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs index 96da3ecac..853e9367a 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientCheckFixture.cs @@ -24,7 +24,7 @@ public void Setup() public void should_return_warning_when_download_client_has_not_been_configured() { Mocker.GetMock() - .Setup(s => s.GetDownloadClients()) + .Setup(s => s.GetDownloadClients(It.IsAny())) .Returns(Array.Empty()); Subject.Check().ShouldBeWarning(); @@ -40,7 +40,7 @@ public void should_return_error_when_download_client_throws() .Throws(); Mocker.GetMock() - .Setup(s => s.GetDownloadClients()) + .Setup(s => s.GetDownloadClients(It.IsAny())) .Returns(new IDownloadClient[] { downloadClient.Object }); Subject.Check().ShouldBeError(); @@ -55,7 +55,7 @@ public void should_return_ok_when_download_client_returns() .Returns(new List()); Mocker.GetMock() - .Setup(s => s.GetDownloadClients()) + .Setup(s => s.GetDownloadClients(It.IsAny())) .Returns(new IDownloadClient[] { downloadClient.Object }); Subject.Check().ShouldBeOk(); diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientRootFolderCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientRootFolderCheckFixture.cs index 54dcf0f2f..831e9de1a 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientRootFolderCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/DownloadClientRootFolderCheckFixture.cs @@ -49,7 +49,7 @@ public void Setup() .Returns(_clientStatus); Mocker.GetMock() - .Setup(s => s.GetDownloadClients()) + .Setup(s => s.GetDownloadClients(It.IsAny())) .Returns(new IDownloadClient[] { _downloadClient.Object }); Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs index ce1c2575a..009ca831f 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs @@ -63,7 +63,7 @@ public void Setup() .Returns(_clientStatus); Mocker.GetMock() - .Setup(s => s.GetDownloadClients()) + .Setup(s => s.GetDownloadClients(It.IsAny())) .Returns(new IDownloadClient[] { _downloadClient.Object }); Mocker.GetMock() diff --git a/src/NzbDrone.Core/HealthCheck/Checks/RemotePathMappingCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/RemotePathMappingCheck.cs index 215d9e16e..61f6cbd93 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/RemotePathMappingCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/RemotePathMappingCheck.cs @@ -53,7 +53,8 @@ public override HealthCheck Check() return new HealthCheck(GetType()); } - var clients = _downloadClientProvider.GetDownloadClients(); + // Only check clients not in failure status, those get another message + var clients = _downloadClientProvider.GetDownloadClients(true); foreach (var client in clients) {