Skip to content

WorkInProgress

Bernd Weigel edited this page May 24, 2024 · 2 revisions

Basic Information

The @WorkInProgress annotation works like the opposite of the @Ignore annotation. If test methods in a test class are annotated with the @WorkInProgress annotation, only those test methods will be executed. All other test methods of the test class, not being annotated with the @WorkInPorgress annotation, get skipped.

Note: To prevent pushing this and messing up your CI/CD test runs by accident, the annotation needs to be enabled via the configuration property neodymium.workInProgress. This is set initially to false in the config/neodymium.properties. Best practice is to enable it in the config/dev-neodymium.properties

Examples

In the following example, only the test method first() will be executed. The test method second() will be skipped due to the missing @WorkInProgress annotation. Therefore the configuration property neodymium.workInProgress needs to be set to true.

public class TestClass
{
	@WorkInProgress
	@Test
	public void first()
	{
	} 

	@Test
	public void second()
	{
	}
}

Now the new test class TestClass2 extends the test class TestClass from above. In this example the test method third() from test class TestClass2 and the test method first() from the test class TestClass get executed. The test method second() from the test class TestClass will be skipped again due to the missing @WorkInProgress annotation. Therefore the configuration property neodymium.workInProgress needs to be set to true.

public class TestClass2 extends TestClass
{
	@WorkInProgress
	@Test
	public void third()
	{
	}
}