@@ -200,7 +200,6 @@ func Test_identity_services_OCSPRespondersAPIService_DeleteByID(t *testing.T) {
200200
201201// Test_identity_services_OCSPRespondersAPIService_FetchOCSPResponders tests the FetchOCSPResponders convenience method
202202func Test_identity_services_OCSPRespondersAPIService_FetchOCSPResponders (t * testing.T ) {
203- t .Skip ("Create returns no model and List fails with deserialization error - cannot retrieve created object ID" )
204203 // Setup the authenticated client
205204 client := SetupIdentitySvcTestClient (t )
206205
@@ -220,20 +219,7 @@ func Test_identity_services_OCSPRespondersAPIService_FetchOCSPResponders(t *test
220219 }
221220 require .NoError (t , err , "Failed to create test object for fetch test" )
222221
223- // Get the ID from list
224- listRes , _ , errList := client .OCSPRespondersAPI .ListOCSPResponders (context .Background ()).Folder ("Prisma Access" ).Name (testName ).Execute ()
225- require .NoError (t , errList , "Failed to list OCSP Responders" )
226- require .Greater (t , len (listRes .Data ), 0 , "Should have at least one OCSP responder" )
227- createdID := listRes .Data [0 ].Id
228-
229- // Cleanup after test
230- defer func () {
231- deleteReq := client .OCSPRespondersAPI .DeleteOCSPRespondersByID (context .Background (), createdID )
232- _ , _ = deleteReq .Execute ()
233- t .Logf ("Cleaned up test object: %s" , createdID )
234- }()
235-
236- // Test 1: Fetch existing object by name
222+ // Test 1: Fetch existing object by name (also used to get ID for cleanup)
237223 fetchedObj , err := client .OCSPRespondersAPI .FetchOCSPResponders (
238224 context .Background (),
239225 testName ,
@@ -245,10 +231,16 @@ func Test_identity_services_OCSPRespondersAPIService_FetchOCSPResponders(t *test
245231 // Verify successful fetch
246232 require .NoError (t , err , "Failed to fetch ocsp_responders by name" )
247233 require .NotNil (t , fetchedObj , "Fetched object should not be nil" )
248- assert .Equal (t , createdID , fetchedObj .Id , "Fetched object ID should match" )
249234 assert .Equal (t , testName , fetchedObj .Name , "Fetched object name should match" )
250235 t .Logf ("[SUCCESS] FetchOCSPResponders found object: %s" , fetchedObj .Name )
251236
237+ // Cleanup after test using ID from fetch
238+ defer func () {
239+ deleteReq := client .OCSPRespondersAPI .DeleteOCSPRespondersByID (context .Background (), fetchedObj .Id )
240+ _ , _ = deleteReq .Execute ()
241+ t .Logf ("Cleaned up test object: %s" , fetchedObj .Id )
242+ }()
243+
252244 // Test 2: Fetch non-existent object (should return nil, nil)
253245 notFound , err := client .OCSPRespondersAPI .FetchOCSPResponders (
254246 context .Background (),
0 commit comments