File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
test/java/net/developerden/backend/controller Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,12 @@ dependencies {
17
17
implementation(" org.springframework.boot:spring-boot-starter-security" )
18
18
implementation(" org.springframework.boot:spring-boot-starter-web" )
19
19
implementation(" org.mariadb.jdbc:mariadb-java-client:2.7.3" )
20
+
20
21
developmentOnly(" org.springframework.boot:spring-boot-devtools" )
22
+
21
23
testImplementation(" org.springframework.boot:spring-boot-starter-test" )
22
24
testImplementation(" org.springframework.security:spring-security-test" )
25
+ testImplementation(" com.h2database:h2" )
23
26
}
24
27
25
28
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 7
7
import org .springframework .boot .test .context .SpringBootTest .WebEnvironment ;
8
8
import org .springframework .boot .test .web .client .TestRestTemplate ;
9
9
import org .springframework .boot .web .server .LocalServerPort ;
10
+ import org .springframework .test .context .ActiveProfiles ;
10
11
11
12
import static org .assertj .core .api .Assertions .assertThat ;
12
13
14
+ @ ActiveProfiles ("test" )
13
15
@ SpringBootTest (webEnvironment = WebEnvironment .RANDOM_PORT )
14
16
public class InfoControllerTest {
15
17
@@ -26,4 +28,4 @@ public void ping_happyDay_returnsPong() {
26
28
String response = this .restTemplate .getForObject (baseUrl + "/ping" , String .class );
27
29
assertThat (response ).isEqualTo ("pong" );
28
30
}
29
- }
31
+ }
You can’t perform that action at this time.
0 commit comments