@@ -1074,6 +1074,10 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) {
10741074 "teams":[{
10751075 "id":4,
10761076 "slug":"t"
1077+ }],
1078+ "apps":[{
1079+ "id":5,
1080+ "slug":"a"
10771081 }]
10781082 },
10791083 "dismiss_stale_reviews":true,
@@ -1086,7 +1090,8 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) {
10861090 },
10871091 "restrictions":{
10881092 "users":[{"id":1,"login":"u"}],
1089- "teams":[{"id":2,"slug":"t"}]
1093+ "teams":[{"id":2,"slug":"t"}],
1094+ "apps":[{"id":3,"slug":"a"}]
10901095 },
10911096 "required_conversation_resolution": {
10921097 "enabled": true
@@ -1119,6 +1124,9 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) {
11191124 Teams : []* Team {
11201125 {Slug : String ("t" ), ID : Int64 (4 )},
11211126 },
1127+ Apps : []* App {
1128+ {Slug : String ("a" ), ID : Int64 (5 )},
1129+ },
11221130 },
11231131 RequireCodeOwnerReviews : true ,
11241132 RequiredApprovingReviewCount : 1 ,
@@ -1134,6 +1142,9 @@ func TestRepositoriesService_GetBranchProtection(t *testing.T) {
11341142 Teams : []* Team {
11351143 {Slug : String ("t" ), ID : Int64 (2 )},
11361144 },
1145+ Apps : []* App {
1146+ {Slug : String ("a" ), ID : Int64 (3 )},
1147+ },
11371148 },
11381149 RequiredConversationResolution : & RequiredConversationResolution {
11391150 Enabled : true ,
@@ -1273,6 +1284,7 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) {
12731284 DismissalRestrictionsRequest : & DismissalRestrictionsRequest {
12741285 Users : & []string {"uu" },
12751286 Teams : & []string {"tt" },
1287+ Apps : & []string {"aa" },
12761288 },
12771289 BypassPullRequestAllowancesRequest : & BypassPullRequestAllowancesRequest {
12781290 Users : []string {"uuu" },
@@ -1318,6 +1330,10 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) {
13181330 "teams":[{
13191331 "id":4,
13201332 "slug":"tt"
1333+ }],
1334+ "apps":[{
1335+ "id":5,
1336+ "slug":"aa"
13211337 }]
13221338 },
13231339 "dismiss_stale_reviews":true,
@@ -1361,6 +1377,9 @@ func TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) {
13611377 Teams : []* Team {
13621378 {Slug : String ("tt" ), ID : Int64 (4 )},
13631379 },
1380+ Apps : []* App {
1381+ {Slug : String ("aa" ), ID : Int64 (5 )},
1382+ },
13641383 },
13651384 RequireCodeOwnerReviews : true ,
13661385 BypassPullRequestAllowances : & BypassPullRequestAllowances {
@@ -1424,6 +1443,7 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) {
14241443 DismissalRestrictionsRequest : & DismissalRestrictionsRequest {
14251444 Users : & []string {"uu" },
14261445 Teams : & []string {"tt" },
1446+ Apps : & []string {"aa" },
14271447 },
14281448 BypassPullRequestAllowancesRequest : & BypassPullRequestAllowancesRequest {
14291449 Users : []string {"uuu" },
@@ -1469,6 +1489,10 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) {
14691489 "teams":[{
14701490 "id":4,
14711491 "slug":"tt"
1492+ }],
1493+ "apps":[{
1494+ "id":5,
1495+ "slug":"aa"
14721496 }]
14731497 },
14741498 "dismiss_stale_reviews":true,
@@ -1512,6 +1536,9 @@ func TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) {
15121536 Teams : []* Team {
15131537 {Slug : String ("tt" ), ID : Int64 (4 )},
15141538 },
1539+ Apps : []* App {
1540+ {Slug : String ("aa" ), ID : Int64 (5 )},
1541+ },
15151542 },
15161543 RequireCodeOwnerReviews : true ,
15171544 BypassPullRequestAllowances : & BypassPullRequestAllowances {
@@ -1557,6 +1584,7 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T)
15571584 DismissalRestrictionsRequest : & DismissalRestrictionsRequest {
15581585 Users : & []string {"uu" },
15591586 Teams : & []string {"tt" },
1587+ Apps : & []string {"aa" },
15601588 },
15611589 BypassPullRequestAllowancesRequest : & BypassPullRequestAllowancesRequest {
15621590 Users : []string {"uuu" },
@@ -1597,6 +1625,10 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T)
15971625 "teams":[{
15981626 "id":4,
15991627 "slug":"tt"
1628+ }],
1629+ "apps":[{
1630+ "id":5,
1631+ "slug":"aa"
16001632 }]
16011633 },
16021634 "dismiss_stale_reviews":true,
@@ -1636,6 +1668,9 @@ func TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T)
16361668 Teams : []* Team {
16371669 {Slug : String ("tt" ), ID : Int64 (4 )},
16381670 },
1671+ Apps : []* App {
1672+ {Slug : String ("aa" ), ID : Int64 (5 )},
1673+ },
16391674 },
16401675 RequireCodeOwnerReviews : true ,
16411676 BypassPullRequestAllowances : & BypassPullRequestAllowances {
@@ -2088,7 +2123,8 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) {
20882123 fmt .Fprintf (w , `{
20892124 "dismissal_restrictions":{
20902125 "users":[{"id":1,"login":"u"}],
2091- "teams":[{"id":2,"slug":"t"}]
2126+ "teams":[{"id":2,"slug":"t"}],
2127+ "apps":[{"id":3,"slug":"a"}]
20922128 },
20932129 "dismiss_stale_reviews":true,
20942130 "require_code_owner_reviews":true,
@@ -2111,6 +2147,9 @@ func TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) {
21112147 Teams : []* Team {
21122148 {Slug : String ("t" ), ID : Int64 (2 )},
21132149 },
2150+ Apps : []* App {
2151+ {Slug : String ("a" ), ID : Int64 (3 )},
2152+ },
21142153 },
21152154 RequireCodeOwnerReviews : true ,
21162155 RequiredApprovingReviewCount : 1 ,
@@ -2143,6 +2182,7 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) {
21432182 DismissalRestrictionsRequest : & DismissalRestrictionsRequest {
21442183 Users : & []string {"u" },
21452184 Teams : & []string {"t" },
2185+ Apps : & []string {"a" },
21462186 },
21472187 }
21482188
@@ -2159,7 +2199,8 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) {
21592199 fmt .Fprintf (w , `{
21602200 "dismissal_restrictions":{
21612201 "users":[{"id":1,"login":"u"}],
2162- "teams":[{"id":2,"slug":"t"}]
2202+ "teams":[{"id":2,"slug":"t"}],
2203+ "apps":[{"id":3,"slug":"a"}]
21632204 },
21642205 "dismiss_stale_reviews":true,
21652206 "require_code_owner_reviews":true,
@@ -2182,6 +2223,9 @@ func TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) {
21822223 Teams : []* Team {
21832224 {Slug : String ("t" ), ID : Int64 (2 )},
21842225 },
2226+ Apps : []* App {
2227+ {Slug : String ("a" ), ID : Int64 (3 )},
2228+ },
21852229 },
21862230 RequireCodeOwnerReviews : true ,
21872231 RequiredApprovingReviewCount : 3 ,
@@ -2515,6 +2559,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio
25152559 DismissalRestrictionsRequest : & DismissalRestrictionsRequest {
25162560 Users : & []string {},
25172561 Teams : & []string {},
2562+ Apps : & []string {},
25182563 },
25192564 }
25202565
@@ -2523,7 +2568,7 @@ func TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestirctio
25232568 t .Errorf ("PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v" , err )
25242569 }
25252570
2526- want = `{"dismissal_restrictions":{"users":[],"teams":[]},"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}`
2571+ want = `{"dismissal_restrictions":{"users":[],"teams":[],"apps":[] },"dismiss_stale_reviews":false,"require_code_owner_reviews":false,"required_approving_review_count":0}`
25272572 if want != string (got ) {
25282573 t .Errorf ("PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v" , string (got ), want )
25292574 }
0 commit comments