diff --git a/src/Altinn.Profile/Controllers/UsersController.cs b/src/Altinn.Profile/Controllers/UsersController.cs index b4b7478..41d13b3 100644 --- a/src/Altinn.Profile/Controllers/UsersController.cs +++ b/src/Altinn.Profile/Controllers/UsersController.cs @@ -58,11 +58,11 @@ public async Task> Get(int userID) /// /// The user uuid /// The information about a given user - [HttpGet("{userUuid:Guid}")] + [HttpGet("byuuid/{userUuid:Guid}")] [Authorize(Policy = "PlatformAccess")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> Get(Guid userUuid) + public async Task> Get([FromRoute] Guid userUuid) { UserProfile result = await _userProfilesWrapper.GetUserByUuid(userUuid); if (result == null) diff --git a/test/Altinn.Profile.Tests/IntegrationTests/UserProfileTests.cs b/test/Altinn.Profile.Tests/IntegrationTests/UserProfileTests.cs index 692fd23..1f0c946 100644 --- a/test/Altinn.Profile.Tests/IntegrationTests/UserProfileTests.cs +++ b/test/Altinn.Profile.Tests/IntegrationTests/UserProfileTests.cs @@ -161,7 +161,7 @@ public async Task GetUsersByUuid_SblBridgeFindsProfile_ResponseOk_ReturnsUserPro }); _webApplicationFactorySetup.SblBridgeHttpMessageHandler = messageHandler; - HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/{userUuid}"); + HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/byuuid/{userUuid}"); httpRequestMessage.Headers.Add("PlatformAccessToken", PrincipalUtil.GetAccessToken("ttd", "unittest")); @@ -196,7 +196,7 @@ public async Task GetUsersByUuid_UserAuthenticatedMissingPlatformAccesToken_Retu const int userId = 20000009; Guid userUuid = new("cc86d2c7-1695-44b0-8e82-e633243fdf31"); - HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/{userUuid}"); + HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/byuuid/{userUuid}"); HttpClient client = _webApplicationFactorySetup.GetTestServerClient(); @@ -223,7 +223,7 @@ public async Task GetUsersByUuid_SblBridgeReturnsNotFound_ResponseNotFound() }); _webApplicationFactorySetup.SblBridgeHttpMessageHandler = messageHandler; - HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/{userUuid}"); + HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/byuuid/{userUuid}"); httpRequestMessage.Headers.Add("PlatformAccessToken", PrincipalUtil.GetAccessToken("ttd", "unittest")); @@ -246,7 +246,7 @@ public async Task GetUsersByUuid_MissingAuthentication_NotAuthorized() // Arrange Guid userUuid = new("cc86d2c7-1695-44b0-8e82-e633243fdf31"); - HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, $"/profile/api/v1/users/{userUuid}"); + HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, $"/profile/api/v1/users/byuuid/{userUuid}"); httpRequestMessage.Headers.Add("PlatformAccessToken", PrincipalUtil.GetAccessToken("ttd", "unittest"));