From b9de027e54f695763d35d971d08f68ce83f5f4b7 Mon Sep 17 00:00:00 2001 From: Rajat Bajaj Date: Fri, 15 Nov 2024 22:07:26 +0530 Subject: [PATCH] Addressed review comment to use String.Slice instead --- management/self_service_profiles_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/management/self_service_profiles_test.go b/management/self_service_profiles_test.go index 85869dfb..f084f151 100644 --- a/management/self_service_profiles_test.go +++ b/management/self_service_profiles_test.go @@ -144,7 +144,8 @@ func TestSelfServiceProfileManager_CreateAndRevokeTicket(t *testing.T) { assert.NotEmpty(t, ticket.GetTicket()) ticketURL := ticket.GetTicket() - ticketID := ticketURL[strings.LastIndex(ticketURL, "=")+1:] + ticketURLSliced := strings.Split(ticketURL, "=") + ticketID := ticketURLSliced[len(ticketURLSliced)-1] err = api.SelfServiceProfile.RevokeTicket(context.Background(), ssop.GetID(), ticketID) assert.NoError(t, err)