-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from cronofy/add-service-account-domain
Add service account domain property to service account user info.
- Loading branch information
Showing
5 changed files
with
35 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.12.2 | ||
1.12.3 |
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 |
---|---|---|
|
@@ -5,20 +5,22 @@ | |
internal sealed class GetUserInfo : Base | ||
{ | ||
[Test] | ||
public void CanGetUserInfoForSericeAccount() | ||
public void CanGetUserInfoForServiceAccount() | ||
{ | ||
this.Http.Stub( | ||
HttpGet | ||
.Url("https://api.cronofy.com/v1/userinfo") | ||
.RequestHeader("Authorization", "Bearer " + AccessToken) | ||
.ResponseCode(200) | ||
.ResponseBody( | ||
@"{ | ||
@" | ||
{ | ||
""sub"": ""ser_61a8b807a341fc00bee53042"", | ||
""cronofy.type"": ""service_account"", | ||
""cronofy.data"": { | ||
""service_account"": { | ||
""provider_name"": ""exchange"" | ||
""provider_name"": ""exchange"", | ||
""domain"": ""example.org"" | ||
}, | ||
""authorization"": { | ||
""scope"": ""service_account/accounts/manage service_account/resources/manage"", | ||
|
@@ -27,7 +29,8 @@ public void CanGetUserInfoForSericeAccount() | |
} | ||
}, | ||
""email"": ""[email protected]"" | ||
}")); | ||
} | ||
")); | ||
|
||
var actualUserInfo = this.Client.GetUserInfo(); | ||
var expectedUserInfo = new UserInfo | ||
|
@@ -38,6 +41,7 @@ public void CanGetUserInfoForSericeAccount() | |
ServiceAccountInfo = new UserInfo.ServiceAccount | ||
{ | ||
ProviderName = "exchange", | ||
Domain = "example.org", | ||
}, | ||
AuthorizationInfo = new UserInfo.Authorization | ||
{ | ||
|