diff --git a/clio.tests/Command/UploadLicensesCommand.Tests.cs b/clio.tests/Command/UploadLicensesCommand.Tests.cs index 4fff804..ea1fc7f 100644 --- a/clio.tests/Command/UploadLicensesCommand.Tests.cs +++ b/clio.tests/Command/UploadLicensesCommand.Tests.cs @@ -56,6 +56,15 @@ public void TestProceedResponse_ResponseWithoutSuccessProperty_DoesNotThrow() { var options = new UploadLicensesOptions(); Assert.DoesNotThrow(() => _command.TestProceedResponse(response, options)); } + + [Test] + public void TestProceedResponse_AuthenticationFailed_ThrowsLicenseInstallationException() { + var response = "{\"Message\":\"Authentication failed.\",\"StackTrace\":null,\"ExceptionType\":\"System.InvalidOperationException\"}"; + var options = new UploadLicensesOptions(); + var ex = Assert.Throws(() => + _command.TestProceedResponse(response, options)); + Assert.That(ex.Message, Is.EqualTo("License not installed: Authentication failed.")); + } } public class UploadLicensesCommandTestable : UploadLicensesCommand diff --git a/clio/Command/UploadLicensesCommand.cs b/clio/Command/UploadLicensesCommand.cs index c4d809d..95df9d8 100644 --- a/clio/Command/UploadLicensesCommand.cs +++ b/clio/Command/UploadLicensesCommand.cs @@ -36,7 +36,10 @@ protected override void ProceedResponse(string response, UploadLicensesOptions o } throw new LicenseInstallationException("License not installed: Unknown error details"); } - base.ProceedResponse(response, options); + if (response.ToLower().Contains("authentication failed")) { + throw new LicenseInstallationException("License not installed: Authentication failed."); + } + base.ProceedResponse(response, options); } } diff --git a/clio/clio.csproj b/clio/clio.csproj index cf0d311..b91aad7 100644 --- a/clio/clio.csproj +++ b/clio/clio.csproj @@ -9,7 +9,7 @@ creatio rnd team cli ATF clio creatio en - 8.0.1.8 + 8.0.1.9 $(AssemblyVersion) $(AssemblyVersion) CLI interface for Creatio