I am writing an app based on Spring Boot. I am trying to understand the difference and implications between doing either of the following:
AbstractApplicationContext context = new AnnotationConfigApplicationContext(AppContext.class); or
SpringApplication.run(MySpringConfiguration.class, args); Particularly I am interested in following implications:
- Autowiring. When I manually get context the concrete objects inside my class don't get autowired even though I can see them in the context, when debugging.
- Testing. Which way is easier to test with?