File tree Expand file tree Collapse file tree
test/java/net/developerden/backend/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,9 +17,12 @@ dependencies {
1717 implementation(" org.springframework.boot:spring-boot-starter-security" )
1818 implementation(" org.springframework.boot:spring-boot-starter-web" )
1919 implementation(" org.mariadb.jdbc:mariadb-java-client:2.7.3" )
20+
2021 developmentOnly(" org.springframework.boot:spring-boot-devtools" )
22+
2123 testImplementation(" org.springframework.boot:spring-boot-starter-test" )
2224 testImplementation(" org.springframework.security:spring-security-test" )
25+ testImplementation(" com.h2database:h2" )
2326}
2427
2528
Original file line number Diff line number Diff line change 1+ spring :
2+ jpa :
3+ hibernate :
4+ ddl-auto : none
5+ show-sql : true
6+ datasource :
7+ url : jdbc:h2:~/testdb;DB_CLOSE_ON_EXIT=FALSE
8+ username : user
9+ password : pass
10+ driver-class-name : org.h2.Driver
11+ security :
12+ oauth2 :
13+ client :
14+ registration :
15+ discord :
16+ clientId : ${DDB_CLIENT_ID}
17+ clientSecret : ${DDB_CLIENT_SECRET}
18+ authorizationGrantType : authorization_code
19+ redirectUri : " {baseUrl}/login/oauth2/code/discord"
20+ scope : identify
21+ provider :
22+ discord :
23+ authorizationUri : https://discord.com/api/oauth2/authorize
24+ tokenUri : https://discord.com/api/oauth2/token
25+
26+
Original file line number Diff line number Diff line change 77import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
88import org .springframework .boot .test .web .client .TestRestTemplate ;
99import org .springframework .boot .web .server .LocalServerPort ;
10+ import org .springframework .test .context .ActiveProfiles ;
1011
1112import static org .assertj .core .api .Assertions .assertThat ;
1213
14+ @ ActiveProfiles ("test" )
1315@ SpringBootTest (webEnvironment = WebEnvironment .RANDOM_PORT )
1416public class InfoControllerTest {
1517
@@ -26,4 +28,4 @@ public void ping_happyDay_returnsPong() {
2628 String response = this .restTemplate .getForObject (baseUrl + "/ping" , String .class );
2729 assertThat (response ).isEqualTo ("pong" );
2830 }
29- }
31+ }
You can’t perform that action at this time.
0 commit comments