O'Reilly logo

Learning Spring Boot 2.0 - Second Edition by Greg L. Turnquist

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing your custom Spring Boot autoconfiguration

If picking between several WebDriver implementations sounds hokey and unnecessarily complicated, then let's do what Spring Boot does best: autoconfigure it!

Okay, if we're going to autoconfigure something, we sure as heck want to test what we're doing. That way, we can make sure it performs as expected. To do so requires a little bit of test setup. Check it out:

 public class WebDriverAutoConfigurationTests { private AnnotationConfigApplicationContext context; @After public void close() { if (this.context != null) { this.context.close(); } } private void load(Class<?>[] configs, String... environment) { AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required