Maven dependency
<dependency> <groupId>org.junit-pioneer</groupId> <artifactId>junit-pioneer</artifactId> <version>0.1.2</version> <scope>test</scope> </dependency>
Java
@Test @ExtendWith(TempDirectory.class) void withProperties(@TempDir Path tempDir) throws IOException { Path path = tempDir.resolve("env.properties"); String properties = "a=b"; Files.write(path, properties.getBytes()); Map<String, Object> props = EnvPropertiesLoader.loadEnvProperties(); assertThat(props.get("a"), is("b")); }
No comments:
Post a Comment