Skip to content

Instantly share code, notes, and snippets.

@bcalmac
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcalmac/a792f6caec763feb3f20 to your computer and use it in GitHub Desktop.
Save bcalmac/a792f6caec763feb3f20 to your computer and use it in GitHub Desktop.
Spring Boot Test configuration that excludes CommandLineRunners
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
@Configuration
@ComponentScan(excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = CommandLineRunner.class))
@EnableAutoConfiguration
public class TestApplicationConfiguration {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment