0

I'm trying to figure out a good solution to having specific unit tests run with certain runtime configurations. For example:

public class TestClassAlpha() { @setup public void setup() { } @After public void tearDown() { } @Test @<only run in particular env> public void testA() { //whatever A } //always run below test no mater what env @Test public void testB() { //whatever B } } 

I am contemplating a custom annotation or custom rule perhaps, but i thought this has to be a question that comes up frequently as running tests in certain conditions (envs) is a very valid scenario. I did some limited searching within stack, and I didn't find anything that really that helped solidify either way.

1 Answer 1

1

This post shows you exactly what you require.

You should Write a Custom TestRule and an annotation to mark the condition.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.