@@ -705,35 +705,3 @@ func TestUpdateConfFile(t *testing.T) {
705705 t .Errorf ("UpdateConfFile expected error on update, got nil" )
706706 }
707707}
708-
709- func TestDeleteConfFileProperty (t * testing.T ) {
710- // Test successful deletion of conf property
711- property := "myproperty"
712- fileName := "outputs"
713-
714- reqLogger := log .FromContext (context .TODO ())
715- scopedLog := reqLogger .WithName ("TestDeleteConfFileProperty" )
716-
717- wantDeleteRequest , _ := http .NewRequest ("DELETE" , fmt .Sprintf ("https://localhost:8089/servicesNS/nobody/system/configs/conf-outputs/%s" , property ), nil )
718-
719- mockSplunkClient := & spltest.MockHTTPClient {}
720- mockSplunkClient .AddHandler (wantDeleteRequest , 200 , "" , nil )
721-
722- c := NewSplunkClient ("https://localhost:8089" , "admin" , "p@ssw0rd" )
723- c .Client = mockSplunkClient
724-
725- err := c .DeleteConfFileProperty (scopedLog , fileName , property )
726- if err != nil {
727- t .Errorf ("DeleteConfFileProperty err = %v" , err )
728- }
729- mockSplunkClient .CheckRequests (t , "TestDeleteConfFileProperty" )
730-
731- // Negative test: error on delete
732- mockSplunkClient = & spltest.MockHTTPClient {}
733- mockSplunkClient .AddHandler (wantDeleteRequest , 500 , "" , nil )
734- c .Client = mockSplunkClient
735- err = c .DeleteConfFileProperty (scopedLog , fileName , property )
736- if err == nil {
737- t .Errorf ("DeleteConfFileProperty expected error on delete, got nil" )
738- }
739- }
0 commit comments