This project is based on chapter 2.2. Adding new beans to the Spring context from book Spring Starts here (2021) by Laurentiu Spilca.
File > New project > Java
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>6.1.10</version>
</dependency>
ApplicationContext context = new AnnotationConfigApplicationContext();
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>6.1.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.11.0-M2</version>
<scope>test</scope>
</dependency>
public class ApplicationTests {
@Test
@DisplayName("Checks that Application Context is created")
public void checkApplicationContextCreated() {
ApplicationContext context = new AnnotationConfigApplicationContext();
assertNotNull(context);
}
}