2

I have an integration test that fetches from a 3rd party API, I'd like to only run this test class manually, is there any way I can ignore the test unless an argument/parameter/env variables is passed? So I can run the test manually with my IDE, but have CI ignore it.

Worth saying that I have unit tests that test smaller portions of the workload that can always run.

1

1 Answer 1

4

With Junit Assume:

public class SomeTest { @Before public void before() throws Exception { Assume.assumeTrue("someValue".equals(System.getProperty("some.property"))); } // add your @Test } 

You could also use @IfProfileValue for tests using spring junit runner

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.