Home

Published

- 1 min read

Unit testing with junit.jupiter


JUnit

Skipping tests on condition

Use the annotation to execute or skip a specific test

 @EnabledIf(<test Class or test Method>)

EnabledIf Docs

	@Test
	@EnabledIf("fileExistsCondition")
	public void test_1() {

Function to evaluate the condition

	boolean fileExistsCondition() {
		return Files.exists(Path.of("some-file.txt"));
	}

Related Posts

There are no related posts yet. 😢