Added JRE exclusion
This commit is contained in:
parent
ece337978c
commit
b8bf616f3e
testing-modules/testing-libraries-2
pom.xml
src/test/java/com/baeldung/environmentvariablesfortest
@ -169,7 +169,7 @@
|
||||
<jacoco.version>0.8.6</jacoco.version>
|
||||
<system-rules.version>1.19.0</system-rules.version>
|
||||
<system-lambda.version>1.0.0</system-lambda.version>
|
||||
<system-stubs.version>2.1.2</system-stubs.version>
|
||||
<system-stubs.version>2.1.3</system-stubs.version>
|
||||
<testng.version>7.8.0</testng.version>
|
||||
<assertj.version>3.24.2</assertj.version>
|
||||
<junit.pioneer.version>2.1.0</junit.pioneer.version>
|
||||
|
@ -32,7 +32,6 @@ class EnvironmentVariablesByAbstractionUnitTest {
|
||||
fakeEnv.put("OS", "MacDowsNix");
|
||||
|
||||
ReadsEnvironment reader = new ReadsEnvironment(fakeEnv::get);
|
||||
assertThat(reader.whatOs())
|
||||
.isEqualTo("MacDowsNix");
|
||||
assertThat(reader.whatOs()).isEqualTo("MacDowsNix");
|
||||
}
|
||||
}
|
||||
|
@ -2,12 +2,14 @@ package com.baeldung.environmentvariablesfortest;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.EnabledForJreRange;
|
||||
import org.junit.jupiter.api.condition.JRE;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
// This test can only work well in Java 15 and below
|
||||
@EnabledForJreRange(min = JRE.JAVA_8, max = JRE.JAVA_16)
|
||||
class EnvironmentVariablesSetDirectlyUnitTest {
|
||||
@BeforeAll
|
||||
static void beforeAll() throws Exception {
|
||||
|
@ -20,8 +20,7 @@ public class EnvironmentVariablesSystemStubsTestNGUnitTest {
|
||||
|
||||
@Test
|
||||
public void givenEnvironmentVariableWasSet_thenItCanBeRead() {
|
||||
assertThat(System.getenv("testng"))
|
||||
.isEqualTo("has environment variables");
|
||||
assertThat(System.getenv("testng")).isEqualTo("has environment variables");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user