fix(backend): add h2 in-memory database to resolve CI application con… - #4
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the backend test setup so the Spring Boot application context can load successfully in CI by providing an in-memory database for tests instead of disabling JDBC auto-configuration.
Changes:
- Removed the
spring.autoconfigure.exclude=...DataSourceAutoConfigurationoverride fromBackendApplicationTests. - Added
com.h2database:h2as atest-scope dependency so tests can bootstrap an embedded datasource. - Minor XML formatting changes in
backend/pom.xml(single-line element compression).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
backend/src/test/java/com/campushub/backend/BackendApplicationTests.java |
Re-enables full Spring context loading during tests (no longer excluding datasource auto-config). |
backend/pom.xml |
Adds H2 for tests so the context can start with an embedded DB; also includes some non-functional formatting changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <licenses><license/></licenses> | ||
| <developers><developer/></developers> | ||
| <scm> | ||
| <connection/> | ||
| <developerConnection/> | ||
| <tag/> | ||
| <url/> | ||
| <connection/><developerConnection/><tag/><url/> | ||
| </scm> |
There was a problem hiding this comment.
This hunk reformats multiple POM sections into single-line XML (e.g., , , ) without functional changes. Keeping the existing multi-line/indented formatting would reduce diff noise and improve readability/mergeability.
| <id>default-compile</id> | ||
| <phase>compile</phase> | ||
| <goals> | ||
| <goal>compile</goal> | ||
| </goals> | ||
| <goals><goal>compile</goal></goals> | ||
| <configuration> |
There was a problem hiding this comment.
The element was collapsed to a single line here. To keep the POM consistent and easier to edit, consider keeping this block expanded/indented (unless an auto-formatter enforces this style).
| <id>default-testCompile</id> | ||
| <phase>test-compile</phase> | ||
| <goals> | ||
| <goal>testCompile</goal> | ||
| </goals> | ||
| <goals><goal>testCompile</goal></goals> | ||
| <configuration> |
There was a problem hiding this comment.
Same as above: collapsing to a single line here increases diff noise and makes future edits harder; consider keeping the original multi-line formatting for consistency.
…text crash