Skip to content

Commit b96244d

Browse files
committed
BAEL-8939: Adding a Spring Context test in all Spring Modules (changes for around 9 more modules.. work in progress..)
1 parent dd273f6 commit b96244d

File tree

10 files changed

+162
-0
lines changed

10 files changed

+162
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
import com.baeldung.ecommerce.EcommerceApplicationIntegrationTest;
9+
10+
@RunWith(SpringRunner.class)
11+
@SpringBootTest(classes = EcommerceApplicationIntegrationTest.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
7+
import org.springframework.test.context.junit4.SpringRunner;
8+
9+
import com.baeldung.autoconfiguration.example.AutoconfigurationApplication;
10+
11+
@RunWith(SpringRunner.class)
12+
@SpringBootTest(classes = AutoconfigurationApplication.class)
13+
@EnableJpaRepositories(basePackages = { "com.baeldung.autoconfiguration.example" })
14+
public class SpringContextIntegrationTest {
15+
16+
@Test
17+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
18+
}
19+
}

spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
<version>${greeter.version}</version>
4141
<optional>true</optional>
4242
</dependency>
43+
44+
<dependency>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-starter-test</artifactId>
47+
<version>1.5.10.RELEASE</version>
48+
<scope>test</scope>
49+
</dependency>
4350

4451
</dependencies>
4552

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.test.context.ContextConfiguration;
6+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
7+
8+
import com.baeldung.greeter.autoconfigure.GreeterAutoConfiguration;
9+
10+
@RunWith(SpringJUnit4ClassRunner.class)
11+
@ContextConfiguration(classes = GreeterAutoConfiguration.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
import com.baeldung.greeter.sample.GreeterSampleApplication;
9+
10+
@RunWith(SpringRunner.class)
11+
@SpringBootTest(classes = GreeterSampleApplication.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
import com.baeldung.h2db.demo.SpringBootApp;
9+
10+
@RunWith(SpringRunner.class)
11+
@SpringBootTest(classes = SpringBootApp.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
import com.baeldung.h2db.demo.ClientSpringBootApp;
9+
10+
@RunWith(SpringRunner.class)
11+
@SpringBootTest(classes = ClientSpringBootApp.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
import com.baeldung.jasypt.Main;
9+
10+
@RunWith(SpringRunner.class)
11+
@SpringBootTest(classes = Main.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
import com.baeldung.Application;
9+
10+
@RunWith(SpringRunner.class)
11+
@SpringBootTest(classes = Application.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.baeldung;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
import com.baeldung.Application;
9+
10+
@RunWith(SpringRunner.class)
11+
@SpringBootTest(classes = Application.class)
12+
public class SpringContextIntegrationTest {
13+
14+
@Test
15+
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
16+
}
17+
}

0 commit comments

Comments
 (0)