@@ -148,3 +148,34 @@ func TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) {
148148 return client .Actions .SetRepoOIDCSubjectClaimCustomTemplate (ctx , "o" , "r" , input )
149149 })
150150}
151+
152+ func TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault (t * testing.T ) {
153+ client , mux , _ , teardown := setup ()
154+ defer teardown ()
155+
156+ mux .HandleFunc ("/repos/o/r/actions/oidc/customization/sub" , func (w http.ResponseWriter , r * http.Request ) {
157+ testMethod (t , r , "PUT" )
158+ testHeader (t , r , "Content-Type" , "application/json" )
159+ testBody (t , r , `{"use_default":true}` + "\n " )
160+ w .WriteHeader (http .StatusCreated )
161+ })
162+
163+ input := & OIDCSubjectClaimCustomTemplate {
164+ UseDefault : Bool (true ),
165+ }
166+ ctx := context .Background ()
167+ _ , err := client .Actions .SetRepoOIDCSubjectClaimCustomTemplate (ctx , "o" , "r" , input )
168+ if err != nil {
169+ t .Errorf ("Actions.SetRepoOIDCSubjectClaimCustomTemplate returned error: %v" , err )
170+ }
171+
172+ const methodName = "SetRepoOIDCSubjectClaimCustomTemplate"
173+ testBadOptions (t , methodName , func () (err error ) {
174+ _ , err = client .Actions .SetRepoOIDCSubjectClaimCustomTemplate (ctx , "\n " , "\n " , input )
175+ return err
176+ })
177+
178+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
179+ return client .Actions .SetRepoOIDCSubjectClaimCustomTemplate (ctx , "o" , "r" , input )
180+ })
181+ }
0 commit comments