@@ -56,17 +56,28 @@ public void testRuntimeEnvironmentPassedAsUserAgent() throws IOException {
5656 @ Test
5757 public void passConfigurationUsingEnvVariables () throws IOException {
5858 SimpleScanner scanner = new SimpleScanner ();
59- BuildResult buildResult = scanner .executeSimpleProject (project ("js-sample" ), ORCHESTRATOR .getServer ().getUrl (), Map .of (), Map .of ("SONAR_SCANNER_JSON_PARAMS" , "{\" sonar.exclusions\" : \" **/Hello.js\" }" ));
59+ BuildResult buildResult = scanner .executeSimpleProject (project ("js-sample" ), ORCHESTRATOR .getServer ().getUrl (), Map .of (),
60+ Map .of ("SONAR_SCANNER_JSON_PARAMS" , "{\" sonar.exclusions\" : \" **/Hello.js\" }" ));
6061 assertThat (buildResult .getLastStatus ()).isZero ();
6162
6263 assertThat (buildResult .getLogs ()).contains ("1 file indexed" );
6364 }
6465
66+ @ Test
67+ public void cacheIsInUserHomeByDefault () throws IOException {
68+ SimpleScanner scanner = new SimpleScanner ();
69+ BuildResult buildResult = scanner .executeSimpleProject (project ("js-sample" ), ORCHESTRATOR .getServer ().getUrl (), Map .of (), Map .of ());
70+ assertThat (buildResult .getLastStatus ()).isZero ();
71+
72+ assertThat (Paths .get (System .getProperty ("user.home" )).resolve (".sonar/cache" )).isDirectoryRecursivelyContaining (("glob:**/*scanner-engine*.jar" ));
73+ }
74+
6575 @ Test
6676 public void overrideHomeDirectoryWithEnv () throws IOException {
6777 var userHome = temp .newFolder ();
6878 SimpleScanner scanner = new SimpleScanner ();
69- BuildResult buildResult = scanner .executeSimpleProject (project ("js-sample" ), ORCHESTRATOR .getServer ().getUrl (), Map .of (), Map .of ("SONAR_USER_HOME" , userHome .getAbsolutePath ()));
79+ BuildResult buildResult = scanner .executeSimpleProject (project ("js-sample" ), ORCHESTRATOR .getServer ().getUrl (), Map .of (),
80+ Map .of ("SONAR_USER_HOME" , userHome .getAbsolutePath ()));
7081 assertThat (buildResult .getLastStatus ()).isZero ();
7182
7283 assertThat (userHome .toPath ().resolve ("cache" )).isDirectoryRecursivelyContaining (("glob:**/*scanner-engine*.jar" ));
0 commit comments