@@ -48,6 +48,8 @@ func TestGranularToolSnaps(t *testing.T) {
4848 GranularSubmitPendingPullRequestReview ,
4949 GranularDeletePendingPullRequestReview ,
5050 GranularAddPullRequestReviewComment ,
51+ GranularResolveReviewThread ,
52+ GranularUnresolveReviewThread ,
5153 }
5254
5355 for _ , constructor := range toolConstructors {
@@ -112,6 +114,8 @@ func TestPullRequestsGranularToolset(t *testing.T) {
112114 "submit_pending_pull_request_review" ,
113115 "delete_pending_pull_request_review" ,
114116 "add_pull_request_review_comment" ,
117+ "resolve_review_thread" ,
118+ "unresolve_review_thread" ,
115119 }
116120 for _ , name := range expected {
117121 assert .Contains (t , toolNames , name )
@@ -700,3 +704,73 @@ func TestGranularAddPullRequestReviewComment(t *testing.T) {
700704 require .NoError (t , err )
701705 assert .False (t , result .IsError )
702706}
707+
708+ func TestGranularResolveReviewThread (t * testing.T ) {
709+ mockedClient := githubv4mock .NewMockedHTTPClient (
710+ githubv4mock .NewMutationMatcher (
711+ struct {
712+ ResolveReviewThread struct {
713+ Thread struct {
714+ ID githubv4.ID
715+ IsResolved githubv4.Boolean
716+ }
717+ } `graphql:"resolveReviewThread(input: $input)"`
718+ }{},
719+ githubv4.ResolveReviewThreadInput {
720+ ThreadID : githubv4 .ID ("PRRT_123" ),
721+ },
722+ nil ,
723+ githubv4mock .DataResponse (map [string ]any {
724+ "resolveReviewThread" : map [string ]any {
725+ "thread" : map [string ]any {"id" : "PRRT_123" , "isResolved" : true },
726+ },
727+ }),
728+ ),
729+ )
730+ gqlClient := githubv4 .NewClient (mockedClient )
731+ deps := BaseDeps {GQLClient : gqlClient }
732+ serverTool := GranularResolveReviewThread (translations .NullTranslationHelper )
733+ handler := serverTool .Handler (deps )
734+
735+ request := createMCPRequest (map [string ]any {
736+ "threadID" : "PRRT_123" ,
737+ })
738+ result , err := handler (ContextWithDeps (context .Background (), deps ), & request )
739+ require .NoError (t , err )
740+ assert .False (t , result .IsError )
741+ }
742+
743+ func TestGranularUnresolveReviewThread (t * testing.T ) {
744+ mockedClient := githubv4mock .NewMockedHTTPClient (
745+ githubv4mock .NewMutationMatcher (
746+ struct {
747+ UnresolveReviewThread struct {
748+ Thread struct {
749+ ID githubv4.ID
750+ IsResolved githubv4.Boolean
751+ }
752+ } `graphql:"unresolveReviewThread(input: $input)"`
753+ }{},
754+ githubv4.UnresolveReviewThreadInput {
755+ ThreadID : githubv4 .ID ("PRRT_123" ),
756+ },
757+ nil ,
758+ githubv4mock .DataResponse (map [string ]any {
759+ "unresolveReviewThread" : map [string ]any {
760+ "thread" : map [string ]any {"id" : "PRRT_123" , "isResolved" : false },
761+ },
762+ }),
763+ ),
764+ )
765+ gqlClient := githubv4 .NewClient (mockedClient )
766+ deps := BaseDeps {GQLClient : gqlClient }
767+ serverTool := GranularUnresolveReviewThread (translations .NullTranslationHelper )
768+ handler := serverTool .Handler (deps )
769+
770+ request := createMCPRequest (map [string ]any {
771+ "threadID" : "PRRT_123" ,
772+ })
773+ result , err := handler (ContextWithDeps (context .Background (), deps ), & request )
774+ require .NoError (t , err )
775+ assert .False (t , result .IsError )
776+ }
0 commit comments