File tree Expand file tree Collapse file tree 5 files changed +38
-6
lines changed
src/test/java/org/spacehub Expand file tree Collapse file tree 5 files changed +38
-6
lines changed Original file line number Diff line number Diff line change 4343 postgresql password : password
4444
4545 - name : Build and run tests
46- run : mvn -B clean verify
46+ run : mvn -Dtest=SmokeTest -DskipTests=false -e -X test
Original file line number Diff line number Diff line change 3535 <artifactId >lombok</artifactId >
3636 <version >1.18.42</version >
3737 </dependency >
38+ <dependency >
39+ <groupId >com.h2database</groupId >
40+ <artifactId >h2</artifactId >
41+ <scope >test</scope >
42+ </dependency >
3843 <dependency >
3944 <groupId >org.springframework.boot</groupId >
4045 <artifactId >spring-boot-starter-test</artifactId >
9398 <artifactId >springdoc-openapi-starter-webmvc-ui</artifactId >
9499 <version >2.2.0</version >
95100 </dependency >
96- <dependency >
97- <groupId >com.h2database</groupId >
98- <artifactId >h2</artifactId >
99- <scope >test</scope >
100- </dependency >
101101 </dependencies >
102102 <build >
103103 <finalName >spaceHub</finalName >
Original file line number Diff line number Diff line change 22
33import org .junit .jupiter .api .Test ;
44import org .springframework .boot .test .context .SpringBootTest ;
5+ import org .springframework .context .annotation .Import ;
56import org .springframework .test .context .ActiveProfiles ; // Import this
67
8+ @ Import (TestBeans .class )
79@ SpringBootTest (webEnvironment = SpringBootTest .WebEnvironment .NONE )
810@ ActiveProfiles ("test" )
911class HomepageTests {
Original file line number Diff line number Diff line change 1+ package org .spacehub ;
2+
3+ import org .junit .jupiter .api .Test ;
4+ import org .springframework .boot .test .context .SpringBootTest ;
5+ import org .springframework .test .context .ActiveProfiles ;
6+ import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
7+ import org .springframework .context .annotation .Import ;
8+
9+ @ SpringBootTest (webEnvironment = WebEnvironment .NONE )
10+ @ ActiveProfiles ("test" )
11+ @ Import (TestBeans .class )
12+ public class SmokeTest {
13+ @ Test
14+ void contextLoads () { }
15+ }
Original file line number Diff line number Diff line change 1+ package org .spacehub ;
2+
3+ import org .springframework .boot .test .context .TestConfiguration ;
4+ import org .springframework .context .annotation .Bean ;
5+ import org .springframework .mail .javamail .JavaMailSender ;
6+ import org .mockito .Mockito ;
7+
8+ @ TestConfiguration
9+ public class TestBeans {
10+
11+ @ Bean
12+ public JavaMailSender javaMailSender () {
13+ return Mockito .mock (JavaMailSender .class );
14+ }
15+ }
You can’t perform that action at this time.
0 commit comments