Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ee3974

Browse files
committed
Swap null user to UnauthorizedAccessException
1 parentce79468 commit3ee3974

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public async Task<KeyConnectorConfirmationDetailsResponseModel> GetKeyConnectorC
189189
varuser=await_userService.GetUserByPrincipalAsync(User);
190190
if(user==null)
191191
{
192-
thrownewNotFoundException();
192+
thrownewUnauthorizedAccessException();
193193
}
194194

195195
vardetails=await_keyConnectorConfirmationDetailsQuery.Run(orgSsoIdentifier,user.Id);

‎test/Api.Test/KeyManagement/Controllers/AccountsKeyManagementControllerTests.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public async Task GetKeyConnectorConfirmationDetailsAsync_NoUser_Throws(
372372
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>())
373373
.ReturnsNull();
374374

375-
awaitAssert.ThrowsAsync<NotFoundException>(()=>
375+
awaitAssert.ThrowsAsync<UnauthorizedAccessException>(()=>
376376
sutProvider.Sut.GetKeyConnectorConfirmationDetailsAsync(orgSsoIdentifier));
377377

378378
awaitsutProvider.GetDependency<IKeyConnectorConfirmationDetailsQuery>().ReceivedWithAnyArgs(0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp