Skip to content

Commit

Permalink
test(Env) : 테스트 환경 yml 분리.
Browse files Browse the repository at this point in the history
  • Loading branch information
F-hiller committed May 5, 2024
1 parent 7a46922 commit e856333
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ out/
.vscode/

### env ###
.env
application-test.yml
.env
46 changes: 46 additions & 0 deletions src/main/resources/application-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
spring:
datasource:
url: "jdbc:h2:mem:community;MODE=mysql"
username: "sa"
password: ""
driver-class-name: org.h2.Driver

# redis 설정
data:
redis:
host: ${REDIS_HOST}
port: ${REDIS_PORT}

jpa:
defer-datasource-initialization: true
hibernate:
ddl-auto: create
naming:
physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect

h2:
console:
enabled: true
path: /h2-console

security:
oauth2:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
redirect-uri: ${GOOGLE_REDIRECT_URI}

logging.level:
org.hibernate:
orm.jdbc.bind: trace
SQL: debug

jwt:
secret: "${JWT_SECRET}"


2 changes: 2 additions & 0 deletions src/test/java/gdsc/comunity/CommunityApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@SpringBootTest
@ActiveProfiles("test")
class CommunityApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.springframework.transaction.annotation.Transactional;

@Transactional
@ActiveProfiles("dev")
@ActiveProfiles("test")
@SpringBootTest(webEnvironment = WebEnvironment.MOCK)
class RefreshTokenRepositoryTest {

Expand Down

0 comments on commit e856333

Please sign in to comment.