Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {
annotationProcessor("org.projectlombok:lombok")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
testRuntimeOnly("com.h2database:h2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

Expand Down
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 BackendApplicationTests {

@Test
Expand Down
39 changes: 16 additions & 23 deletions backend/src/test/resources/application-test.properties
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
# Test configuration
spring.application.name=pennywise-test
spring.application.name=pennywise

# Database - Uses environment variables from CI or defaults for local testing
spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/pennywise_test}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME:pennywise}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:pennywise}
spring.datasource.driver-class-name=org.postgresql.Driver
# ===============================
# DATABASE (tests)
# ===============================
spring.datasource.url=jdbc:h2:mem:pennywise_test;MODE=PostgreSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver

# JPA
spring.jpa.hibernate.ddl-auto=none
# ===============================
# JPA / HIBERNATE (tests)
# ===============================
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=false

# Flyway
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration
spring.flyway.baseline-on-migrate=true
spring.flyway.clean-disabled=false

# Logging - reduce noise in tests
logging.level.root=WARN
logging.level.com.pennywise=INFO
logging.level.org.springframework.security=WARN

# Security - disable for tests
spring.security.user.name=test
spring.security.user.password=test
# ===============================
# FLYWAY (tests)
# ===============================
spring.flyway.enabled=false

Loading