diff --git a/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs b/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs index c377d0257..cebf4e335 100644 --- a/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs +++ b/src/Okta.Sdk.IntegrationTests/GroupScenarios.cs @@ -91,10 +91,32 @@ await Assert.ThrowsAsync( () => client.Groups.GetGroupAsync(createdGroup.Id)); } - [Fact(Skip = "TODO")] + [Fact] public async Task UpdateGroup() { - throw new NotImplementedException(); + var client = GetClient("group-update"); + + var createdGroup = await client.Groups.CreateGroupAsync(new CreateGroupOptions + { + Name = "Update Test Group", + }); + + await Task.Delay(1000); + createdGroup.Profile.Description = "This group has been updated"; + + try + { + var updatedGroup = await createdGroup.UpdateAsync(); + updatedGroup.LastUpdated.Value.Should().BeAfter(updatedGroup.Created.Value); + } + finally + { + await createdGroup.DeleteAsync(); + } + + // Getting by ID should result in 404 error + await Assert.ThrowsAsync( + () => client.Groups.GetGroupAsync(createdGroup.Id)); } [Fact(Skip = "TODO")] diff --git a/src/Okta.Sdk/OktaClient.cs b/src/Okta.Sdk/OktaClient.cs index 9759f6160..62a369511 100644 --- a/src/Okta.Sdk/OktaClient.cs +++ b/src/Okta.Sdk/OktaClient.cs @@ -165,7 +165,7 @@ protected CollectionClient GetCollectionClient(HttpRequest initialRequest) public async Task PutAsync(HttpRequest request, CancellationToken cancellationToken = default(CancellationToken)) where TResponse : Resource, new() { - var response = await _dataStore.PostAsync(request, _requestContext, cancellationToken).ConfigureAwait(false); + var response = await _dataStore.PutAsync(request, _requestContext, cancellationToken).ConfigureAwait(false); return response?.Payload; }