@@ -11,6 +11,7 @@ import (
1111 "testing"
1212 "time"
1313
14+ codacyclient "codacy/cli-v2/codacy-client"
1415 "codacy/cli-v2/domain"
1516
1617 "github.com/stretchr/testify/assert"
@@ -274,9 +275,9 @@ func TestCreateLanguagesConfigFile_ExtensionsFromRepository(t *testing.T) {
274275 defer server .Close ()
275276
276277 // Patch CodacyApiBase to use the test server
277- oldBase := CodacyApiBase
278- CodacyApiBase = server .URL
279- defer func () { CodacyApiBase = oldBase }()
278+ oldBase := codacyclient . CodacyApiBase
279+ codacyclient . CodacyApiBase = server .URL
280+ defer func () { codacyclient . CodacyApiBase = oldBase }()
280281
281282 apiTools := []domain.Tool {
282283 {Uuid : "eslint-uuid" },
@@ -289,14 +290,20 @@ func TestCreateLanguagesConfigFile_ExtensionsFromRepository(t *testing.T) {
289290 "pmd-uuid" : "pmd" ,
290291 }
291292
292- err := CreateLanguagesConfigFile (apiTools , tempDir , toolIDMap , "test-token" , "gh" , "org" , "repo" )
293+ initFlags := domain.InitFlags {
294+ ApiToken : "test-token" ,
295+ Provider : "gh" ,
296+ Organization : "org" ,
297+ Repository : "repo" ,
298+ }
299+ err := CreateLanguagesConfigFile (apiTools , tempDir , toolIDMap , initFlags )
293300 assert .NoError (t , err )
294301
295302 // Read and unmarshal the generated YAML
296303 data , err := os .ReadFile (tempDir + "/languages-config.yaml" )
297304 assert .NoError (t , err )
298305
299- var config LanguagesConfig
306+ var config domain. LanguagesConfig
300307 err = yaml .Unmarshal (data , & config )
301308 assert .NoError (t , err )
302309
@@ -309,11 +316,11 @@ func TestCreateLanguagesConfigFile_ExtensionsFromRepository(t *testing.T) {
309316 assert .ElementsMatch (t , []string {".cls" , ".app" , ".trigger" , ".scala" , ".rb" , ".gemspec" , ".js" , ".jsx" , ".vue" }, pmd .Extensions )
310317}
311318
312- func findTool (tools []ToolLanguageInfo , name string ) ToolLanguageInfo {
319+ func findTool (tools []domain. ToolLanguageInfo , name string ) domain. ToolLanguageInfo {
313320 for _ , t := range tools {
314321 if t .Name == name {
315322 return t
316323 }
317324 }
318- return ToolLanguageInfo {}
325+ return domain. ToolLanguageInfo {}
319326}
0 commit comments