Skip to content

Commit

Permalink
Merge pull request #117 from okta/92-update-group
Browse files Browse the repository at this point in the history
Group Update and a small big fix 💥
  • Loading branch information
leebrandt committed Jul 7, 2017
2 parents 970bea3 + f4fd7bd commit 22e40ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 24 additions & 2 deletions src/Okta.Sdk.IntegrationTests/GroupScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,32 @@ await Assert.ThrowsAsync<OktaApiException>(
() => 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<OktaApiException>(
() => client.Groups.GetGroupAsync(createdGroup.Id));
}

[Fact(Skip = "TODO")]
Expand Down
2 changes: 1 addition & 1 deletion src/Okta.Sdk/OktaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected CollectionClient<T> GetCollectionClient<T>(HttpRequest initialRequest)
public async Task<TResponse> PutAsync<TResponse>(HttpRequest request, CancellationToken cancellationToken = default(CancellationToken))
where TResponse : Resource, new()
{
var response = await _dataStore.PostAsync<TResponse>(request, _requestContext, cancellationToken).ConfigureAwait(false);
var response = await _dataStore.PutAsync<TResponse>(request, _requestContext, cancellationToken).ConfigureAwait(false);
return response?.Payload;
}

Expand Down

0 comments on commit 22e40ae

Please sign in to comment.