Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Test assumeThat not working with @SpringRunner and @SpringBootTest #1632

Closed
meltsufin opened this issue Apr 4, 2019 · 2 comments
Closed
Labels
testing Affects tests only

Comments

@meltsufin
Copy link
Contributor

Before today, a failing assumption in @BeforeClass would cause the whole test to be skipped.
However, now the Spring application context for the test starts up even if the test is disabled with assumeThat.

Example:

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = { SqlApplication.class })
public class SqlMysqlSampleApplicationTests {
	@BeforeClass
	public static void checkToRun() {
		assumeThat(
				"SQL sample integration tests are disabled. Please use '-Dit.cloudsql=true' "
						+ "to enable them. ",
				System.getProperty("it.cloudsql"), is("true"));
	}
...
}
@meltsufin meltsufin added the testing Affects tests only label Apr 4, 2019
@artembilan
Copy link
Contributor

@meltsufin
Copy link
Contributor Author

Looks like it's fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testing Affects tests only
Development

No branches or pull requests

2 participants