-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SLVS-1818 Upgrade SLCore to 10.14.0.80189 and adapt RPC changes for S…
…QC multi-region (#5985) [SLVS-1818](https://sonarsource.atlassian.net/browse/SLVS-1818) [SLVS-1818]: https://sonarsource.atlassian.net/browse/SLVS-1818?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information
1 parent
bf1d0cb
commit 3edccfa
Showing
21 changed files
with
278 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,8 @@ public void Serialize_WithSonarCloudToken_AsExpected() | |
"organization": "my-org", | ||
"credentials": { | ||
"token": "super-secret-token" | ||
} | ||
}, | ||
"region": "EU" | ||
} | ||
} | ||
"""; | ||
|
@@ -131,7 +132,8 @@ public void Serialize_WithSonarCloudUsernamePassword_AsExpected() | |
"credentials": { | ||
"username": "[email protected]", | ||
"password": "betwEEn-me-and-U" | ||
} | ||
}, | ||
"region": "EU" | ||
} | ||
} | ||
"""; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,8 @@ public void Serialize_WithSonarCloudToken_AsExpected() | |
"organization": "my-org", | ||
"credentials": { | ||
"token": "super-secret-token" | ||
} | ||
}, | ||
"region": "EU" | ||
}, | ||
"projectKeys": [ | ||
"project-key-1", | ||
|
@@ -149,7 +150,8 @@ public void Serialize_WithSonarCloudUsernamePassword_AsExpected() | |
"credentials": { | ||
"username": "[email protected]", | ||
"password": "betwEEn-me-and-U" | ||
} | ||
}, | ||
"region": "EU" | ||
}, | ||
"projectKeys": [ | ||
"project-key-1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
src/SLCore.UnitTests/Service/Connection/Models/SonarCloudConnectionConfigurationDtoTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* SonarLint for Visual Studio | ||
* Copyright (C) 2016-2025 SonarSource SA | ||
* mailto:info AT sonarsource DOT com | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
using Newtonsoft.Json; | ||
using SonarLint.VisualStudio.SLCore.Service.Connection.Models; | ||
|
||
namespace SonarLint.VisualStudio.SLCore.UnitTests.Service.Connection.Models; | ||
|
||
[TestClass] | ||
public class SonarCloudConnectionConfigurationDtoTests | ||
{ | ||
|
||
[DataRow("id", true, "org", SonarCloudRegion.EU, """ | ||
{ | ||
"organization": "org", | ||
"region": "EU", | ||
"connectionId": "id", | ||
"disableNotification": true | ||
} | ||
""")] | ||
[DataRow("id id id", true, "org", SonarCloudRegion.EU, """ | ||
{ | ||
"organization": "org", | ||
"region": "EU", | ||
"connectionId": "id id id", | ||
"disableNotification": true | ||
} | ||
""")] | ||
[DataRow("id", false, "org", SonarCloudRegion.EU, """ | ||
{ | ||
"organization": "org", | ||
"region": "EU", | ||
"connectionId": "id", | ||
"disableNotification": false | ||
} | ||
""")] | ||
[DataRow("id", true, "org org org", SonarCloudRegion.EU, """ | ||
{ | ||
"organization": "org org org", | ||
"region": "EU", | ||
"connectionId": "id", | ||
"disableNotification": true | ||
} | ||
""")] | ||
[DataRow("id", true, "org", SonarCloudRegion.US, """ | ||
{ | ||
"organization": "org", | ||
"region": "US", | ||
"connectionId": "id", | ||
"disableNotification": true | ||
} | ||
""")] | ||
[DataTestMethod] | ||
public void Serialize_AsExpected(string id, bool notificationEnabled, string organization, SonarCloudRegion region, string expected) => | ||
JsonConvert.SerializeObject(new SonarCloudConnectionConfigurationDto(id, notificationEnabled, organization, region), Formatting.Indented).Should().Be(expected); | ||
} |
Oops, something went wrong.