@@ -48,7 +48,7 @@ func TestVscodeSetupCommand(t *testing.T) {
4848 expectedServiceURL := serverDetails .ArtifactoryUrl + "api/aieditorextensions/" + repoName + "/_apis/public/gallery"
4949
5050 // Run the VSCode setup command
51- runJfrogCli (t , "vscode-config " , expectedServiceURL , "--product-json-path" , productPath )
51+ runJfrogCli (t , "ide" , "setup" , " vscode" , expectedServiceURL , "--product-json-path" , productPath )
5252
5353 // Verify the configuration was applied
5454 modifiedData , err := os .ReadFile (productPath )
@@ -126,7 +126,7 @@ func TestVscodeAutoDetection(t *testing.T) {
126126 serviceURL := serverDetails .ArtifactoryUrl + "api/aieditorextensions/" + repoName + "/_apis/public/gallery"
127127
128128 // Test with an explicit path (simulating successful auto-detection)
129- runJfrogCli (t , "vscode-config " , serviceURL , "--product-json-path" , productPath )
129+ runJfrogCli (t , "ide" , "setup" , " vscode" , serviceURL , "--product-json-path" , productPath )
130130
131131 // Verify configuration was applied
132132 modifiedData , err := os .ReadFile (productPath )
@@ -172,10 +172,10 @@ func TestVscodeInvalidRepository(t *testing.T) {
172172 if serverDetails != nil {
173173 var err error
174174 if serverDetails .AccessToken != "" {
175- err = execJfrogCli ("vscode-config " , "--repo-key" , "non-existent-repo" , "--product-json-path" , productPath ,
175+ err = execJfrogCli ("ide" , "setup" , " vscode" , "--repo-key" , "non-existent-repo" , "--product-json-path" , productPath ,
176176 "--url" , serverDetails .ArtifactoryUrl , "--access-token" , serverDetails .AccessToken )
177177 } else {
178- err = execJfrogCli ("vscode-config " , "--repo-key" , "non-existent-repo" , "--product-json-path" , productPath ,
178+ err = execJfrogCli ("ide" , "setup" , " vscode" , "--repo-key" , "non-existent-repo" , "--product-json-path" , productPath ,
179179 "--url" , serverDetails .ArtifactoryUrl , "--user" , serverDetails .User , "--password" , serverDetails .Password )
180180 }
181181 assert .Error (t , err , "Command should fail with invalid repository" )
@@ -223,7 +223,7 @@ func TestVscodePermissionHandling(t *testing.T) {
223223 serviceURL := serverDetails .ArtifactoryUrl + "api/aieditorextensions/" + repoName + "/_apis/public/gallery"
224224
225225 // Command should fail due to permission issues
226- err = execJfrogCli ("vscode-config " , serviceURL , "--product-json-path" , productPath )
226+ err = execJfrogCli ("ide" , "setup" , " vscode" , serviceURL , "--product-json-path" , productPath )
227227 assert .Error (t , err , "Command should fail due to permission issues" )
228228
229229 // Restore permissions for cleanup
@@ -272,7 +272,7 @@ ide.system.path=${user.home}/.local/share/JetBrains/IntelliJIdea2023.3
272272 require .NoError (t , err )
273273
274274 // Test JetBrains setup command
275- expectedRepositoryURL := serverDetails .ArtifactoryUrl + "api/jetbrainsplugins /" + repoName
275+ expectedRepositoryURL := serverDetails .ArtifactoryUrl + "api/aieditorextensions /" + repoName
276276
277277 // Set environment variable to make the mock IDE detectable (OS-specific)
278278 var envVar , envValue string
@@ -307,7 +307,7 @@ ide.system.path=${user.home}/.local/share/JetBrains/IntelliJIdea2023.3
307307 }
308308
309309 // Run the JetBrains setup command
310- runJfrogCli (t , "jetbrains-config " , expectedRepositoryURL )
310+ runJfrogCli (t , "ide" , "setup" , " jetbrains" , expectedRepositoryURL )
311311
312312 // Verify the configuration was applied
313313 modifiedProperties , err := os .ReadFile (propertiesPath )
@@ -411,10 +411,10 @@ func TestJetbrainsAutoDetection(t *testing.T) {
411411 }
412412
413413 // Test JetBrains auto-detection command
414- repositoryURL := serverDetails .ArtifactoryUrl + "api/jetbrainsplugins /" + repoName
414+ repositoryURL := serverDetails .ArtifactoryUrl + "api/aieditorextensions /" + repoName
415415
416416 // Note: This will work if the auto-detection logic finds our mock IDEs
417- runJfrogCli (t , "jetbrains-config " , repositoryURL )
417+ runJfrogCli (t , "ide" , "setup" , " jetbrains" , repositoryURL )
418418
419419 // Verify configuration was applied to detected IDEs
420420 for _ , ide := range ides {
@@ -472,10 +472,10 @@ ide.config.path=${user.home}/.config/JetBrains/IntelliJIdea2023.3
472472 if serverDetails != nil {
473473 var err error
474474 if serverDetails .AccessToken != "" {
475- err = execJfrogCli ("jetbrains-config " , "--repo-key" , "non-existent-repo" ,
475+ err = execJfrogCli ("ide" , "setup" , " jetbrains" , "--repo-key" , "non-existent-repo" ,
476476 "--url" , serverDetails .ArtifactoryUrl , "--access-token" , serverDetails .AccessToken )
477477 } else {
478- err = execJfrogCli ("jetbrains-config " , "--repo-key" , "non-existent-repo" ,
478+ err = execJfrogCli ("ide" , "setup" , " jetbrains" , "--repo-key" , "non-existent-repo" ,
479479 "--url" , serverDetails .ArtifactoryUrl , "--user" , serverDetails .User , "--password" , serverDetails .Password )
480480 }
481481 assert .Error (t , err , "Command should fail with invalid repository" )
@@ -536,10 +536,10 @@ ide.config.path=${user.home}/.config/JetBrains/IntelliJIdea2023.3
536536 t .Fatalf ("Failed to set XDG_CONFIG_HOME: %v" , err )
537537 }
538538
539- repositoryURL := serverDetails .ArtifactoryUrl + "api/jetbrainsplugins /" + repoName
539+ repositoryURL := serverDetails .ArtifactoryUrl + "api/aieditorextensions /" + repoName
540540
541541 // Command should fail due to permission issues
542- err = execJfrogCli ("jetbrains-config " , repositoryURL )
542+ err = execJfrogCli ("ide" , "setup" , " jetbrains" , repositoryURL )
543543 assert .Error (t , err , "Command should fail due to permission issues" )
544544
545545 // Restore permissions for cleanup
@@ -647,7 +647,7 @@ func BenchmarkVscodeSetup(b *testing.B) {
647647
648648 // Run the setup command
649649 jfrogCli := coreTests .NewJfrogCli (execMain , "jfrog" , "" )
650- err = jfrogCli .Exec ("vscode-config " , serviceURL , "--product-json-path" , productPath )
650+ err = jfrogCli .Exec ("ide" , "setup" , " vscode" , serviceURL , "--product-json-path" , productPath )
651651 if err != nil {
652652 b .Fatal (err )
653653 }
@@ -705,7 +705,7 @@ ide.config.path=${user.home}/.config/JetBrains/IntelliJIdea2023.3
705705 t .Fatalf ("Failed to set XDG_CONFIG_HOME: %v" , err )
706706 }
707707
708- repositoryURL := serverDetails .ArtifactoryUrl + "api/jetbrainsplugins /" + repoName
708+ repositoryURL := serverDetails .ArtifactoryUrl + "api/aieditorextensions /" + repoName
709709
710710 b .ResetTimer ()
711711 for i := 0 ; i < b .N ; i ++ {
@@ -717,7 +717,7 @@ ide.config.path=${user.home}/.config/JetBrains/IntelliJIdea2023.3
717717
718718 // Run the setup command
719719 jfrogCli := coreTests .NewJfrogCli (execMain , "jfrog" , "" )
720- err = jfrogCli .Exec ("jetbrains-config " , repositoryURL )
720+ err = jfrogCli .Exec ("ide" , "setup" , " jetbrains" , repositoryURL )
721721 if err != nil {
722722 b .Fatal (err )
723723 }
@@ -729,16 +729,12 @@ func TestIDECommandsRegistration(t *testing.T) {
729729 // This test verifies that our IDE commands are properly registered in the CLI
730730 // without requiring a running Artifactory server
731731
732- // Test that VSCode command is available
732+ // Test that IDE setup command is available
733733 jfrogCli := coreTests .NewJfrogCli (execMain , "jfrog" , "" )
734- err := jfrogCli .Exec ("vscode-config " , "--help" )
735- assert .NoError (t , err , "VSCode config command should be available" )
734+ err := jfrogCli .Exec ("ide" , "setup " , "--help" )
735+ assert .NoError (t , err , "IDE setup command should be available" )
736736
737- // Test that JetBrains command is available
738- err = jfrogCli .Exec ("jetbrains-config" , "--help" )
739- assert .NoError (t , err , "JetBrains config command should be available" )
740-
741- // Test that JetBrains alias is available
742- err = jfrogCli .Exec ("jb" , "--help" )
743- assert .NoError (t , err , "JetBrains alias 'jb' should be available" )
737+ // Test that IDE command is available with alias
738+ err = jfrogCli .Exec ("ide" , "s" , "--help" )
739+ assert .NoError (t , err , "IDE setup alias 's' should be available" )
744740}
0 commit comments