I use the spring-boot-starter-web and spring-boot-starter-test.
Let\'s say I have a class for binding configuration properties:
@ConfigurationPropert
I think the easiest way is:
public class InvalidUrlTest {
@Rule
public DisableOnDebug testTimeout = new DisableOnDebug(new Timeout(5, TimeUnit.SECONDS));
@Rule
public ExpectedException expected = ExpectedException.none();
@Test
public void shouldFailOnStartIfUrlInvalid() {
// configure ExpectedException
expected.expect(...
MyApplication.main("--dummy.url=123:456");
}
// other cases
}