Unit testing with junit.jupiter

August 18, 2024

Skipping tests on condition

Use the annotation to execute or skip a specific test

@EnabledIf()

EnabledIf


	@Test
	@EnabledIf("fileExistsCondition")
	public void test_1() {
	boolean fileExistsCondition() {
		return Files.exists(Path.of("some-file.txt"));
	}