Skip to content

Documentation mentions ListWriter #5634

@sdavids

Description

@sdavids

https://docs.junit.org/6.0.3/writing-tests/built-in-extensions.html#TempDirectory

@Test
void writeItemsToFile(@TempDir Path tempDir) throws IOException {
	Path file = tempDir.resolve("test.txt");

	new ListWriter(file).write("a", "b", "c");

	assertEquals(List.of("a,b,c"), Files.readAllLines(file));
}

This code snippet and others use ListWriter.

ListWriter is not a part of the JUnit API nor the JDK.

Please rewrite the example to only use JDK or JUnit API, thanks.

This should be improved in the 5.x and 6.x docs.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions