Skip to content

Commit

Permalink
improve after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
erwan-serandour committed Oct 29, 2024
1 parent 21e0180 commit 45e1a2d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions its/src/test/java/com/sonar/maven/it/suite/JavaTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,9 @@ void setJavaVersionProperties() throws IOException {

@Test
void when_java_home_exists_it_is_used_as_default_sonar_java_jdkHome_value() throws IOException {
//verify that property java home exists, it may not be pointing to a jdk
Assumptions.assumeTrue(System.getProperties().containsKey("java.home"));

//fix value, the plugin should not modify them
String javaHomeSystem = System.getProperty("java.home");


File outputProps = temp.resolve("out.properties").toFile();
outputProps.createNewFile();
File pom = ItUtils.locateProjectPom("jdkHome/defaultValue");
Expand All @@ -143,7 +139,7 @@ void when_java_home_exists_it_is_used_as_default_sonar_java_jdkHome_value() thro
Properties props = getProps(outputProps);
String jdkHome = props.getProperty("sonar.java.jdkHome");
//the jdk is not configured in the project, so default value should be used
assertThat(jdkHome).isIn(Arrays.asList(javaHomeSystem));
assertThat(jdkHome).isEqualTo(javaHomeSystem);
}

@Test
Expand Down

0 comments on commit 45e1a2d

Please sign in to comment.