@@ -71,6 +71,7 @@ func getRESTClient(t *testing.T) *gogithub.Client {
7171
7272 // Create a new GitHub client with the token
7373 ghClient := gogithub .NewClient (nil ).WithAuthToken (token )
74+
7475 if host := getE2EHost (); host != "https://github.com" {
7576 var err error
7677 // Currently this works for GHEC because the API is exposed at the api subdomain and the path prefix
@@ -1600,6 +1601,13 @@ func TestE2E_ManageNotificationSubscription(t *testing.T) {
16001601 require .True (t , ok )
16011602 require .Contains (t , textContent .Text , "ignored" )
16021603
1604+ // Validate with REST client
1605+ restClient := getRESTClient (t )
1606+ sub , _ , err := restClient .Activity .GetThreadSubscription (ctx , notificationID )
1607+ require .NoError (t , err )
1608+ require .NotNil (t , sub )
1609+ require .True (t , sub .GetIgnored (), "expected notification subscription to be ignored" )
1610+
16031611 // Watch notification
16041612 watchReq := mcp.CallToolRequest {}
16051613 watchReq .Params .Name = "manage_notification_subscription"
@@ -1614,6 +1622,13 @@ func TestE2E_ManageNotificationSubscription(t *testing.T) {
16141622 require .True (t , ok )
16151623 require .Contains (t , textContent .Text , "subscribed" )
16161624
1625+ // Validate with REST client
1626+ sub , _ , err = restClient .Activity .GetThreadSubscription (ctx , notificationID )
1627+ require .NoError (t , err )
1628+ require .NotNil (t , sub )
1629+ require .False (t , sub .GetIgnored (), "expected notification subscription to not be ignored (watch)" )
1630+ require .True (t , sub .GetSubscribed (), "expected notification subscription to be subscribed" )
1631+
16171632 // Delete notification subscription
16181633 deleteReq := mcp.CallToolRequest {}
16191634 deleteReq .Params .Name = "manage_notification_subscription"
@@ -1627,6 +1642,13 @@ func TestE2E_ManageNotificationSubscription(t *testing.T) {
16271642 textContent , ok = resp .Content [0 ].(mcp.TextContent )
16281643 require .True (t , ok )
16291644 require .Contains (t , textContent .Text , "deleted" )
1645+
1646+ // Validate with REST client
1647+ sub , resp2 , err := restClient .Activity .GetThreadSubscription (ctx , notificationID )
1648+ // According to GitHub API, a deleted subscription returns 404
1649+ require .Error (t , err )
1650+ require .Nil (t , sub )
1651+ require .Equal (t , 404 , resp2 .StatusCode )
16301652}
16311653
16321654func TestE2E_ManageRepositoryNotificationSubscription (t * testing.T ) {
@@ -1654,6 +1676,13 @@ func TestE2E_ManageRepositoryNotificationSubscription(t *testing.T) {
16541676 require .True (t , ok )
16551677 require .Contains (t , textContent .Text , "ignored" )
16561678
1679+ // Validate with REST client
1680+ restClient := getRESTClient (t )
1681+ sub , _ , err := restClient .Activity .GetRepositorySubscription (ctx , owner , repo )
1682+ require .NoError (t , err )
1683+ require .NotNil (t , sub )
1684+ require .True (t , sub .GetIgnored (), "expected repository subscription to be ignored" )
1685+
16571686 // Watch repo notifications
16581687 watchReq := mcp.CallToolRequest {}
16591688 watchReq .Params .Name = "manage_repository_notification_subscription"
@@ -1669,6 +1698,13 @@ func TestE2E_ManageRepositoryNotificationSubscription(t *testing.T) {
16691698 require .True (t , ok )
16701699 require .Contains (t , textContent .Text , "subscribed" )
16711700
1701+ // Validate with REST client
1702+ sub , _ , err = restClient .Activity .GetRepositorySubscription (ctx , owner , repo )
1703+ require .NoError (t , err )
1704+ require .NotNil (t , sub )
1705+ require .False (t , sub .GetIgnored (), "expected repository subscription to not be ignored (watch)" )
1706+ require .True (t , sub .GetSubscribed (), "expected repository subscription to be subscribed" )
1707+
16721708 // Delete repo notification subscription
16731709 deleteReq := mcp.CallToolRequest {}
16741710 deleteReq .Params .Name = "manage_repository_notification_subscription"
@@ -1683,6 +1719,13 @@ func TestE2E_ManageRepositoryNotificationSubscription(t *testing.T) {
16831719 textContent , ok = resp .Content [0 ].(mcp.TextContent )
16841720 require .True (t , ok )
16851721 require .Contains (t , textContent .Text , "deleted" )
1722+
1723+ // Validate with REST client
1724+ sub , resp2 , err := restClient .Activity .GetRepositorySubscription (ctx , owner , repo )
1725+ // According to GitHub API, a deleted subscription returns 404
1726+ require .Error (t , err )
1727+ require .Nil (t , sub )
1728+ require .Equal (t , 404 , resp2 .StatusCode )
16861729}
16871730
16881731func TestE2E_DismissNotification (t * testing.T ) {
0 commit comments