Skip to content

Instantly share code, notes, and snippets.

@cristopher-rodrigues
Created August 4, 2016 18:24
Show Gist options
  • Save cristopher-rodrigues/8ebe41f8becf9cc450e5c0e1f52eb461 to your computer and use it in GitHub Desktop.
Save cristopher-rodrigues/8ebe41f8becf9cc450e5c0e1f52eb461 to your computer and use it in GitHub Desktop.
Spring boot app context
// AppContext
@Configuration
@EnableAutoConfiguration
@ComponentScan(basePackages={"ebanx?"})
public class AppContext {
}
// Application
@SpringBootApplication
public class Application {
public static void main(String[] args){
SpringApplication.run(AppContext.class, args);
}
}
// AbstractTest
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes=AppContextTest.class)
public abstract class AbstractTest {
}
// AppContextTest
@Configuration
@Import(value={AppContext.class})
@ComponentScan(basePackages={"ebanx?"})
public class AppContextTest {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment