File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
java/com/example/demo/integration Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,16 @@ class PlayerControllerIntegrationTest {
3434 void setUp () {
3535 mockMvc = MockMvcBuilders .webAppContextSetup (webApplicationContext ).build ();
3636
37- // Create test data
37+ // Create test data - ensure schema is created first
3838 Player testPlayer = new Player ();
3939 testPlayer .setName ("Test Player" );
4040 testPlayer .setPosition ("MID" );
4141 testPlayer .setTeam ("Arsenal" );
42- testPlayer .setValue (50 );
42+ testPlayer .setValue (50.0 );
4343 testPlayer .setTotalPoints (100 );
4444 testPlayer .setWeeklyPoints (10 );
45- playerRepository .save (testPlayer );
45+ testPlayer .setFplId (1L );
46+ playerRepository .saveAndFlush (testPlayer );
4647 }
4748
4849 @ Test
Original file line number Diff line number Diff line change 11# Test profile configuration
22spring.application.name =demo-test
33
4- # Use H2 in-memory database for tests
5- spring.datasource.url =jdbc:h2:mem:testdb
4+ # Use H2 in-memory database for tests (case-insensitive mode)
5+ spring.datasource.url =jdbc:h2:mem:testdb;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
66spring.datasource.driver-class-name =org.h2.Driver
77spring.datasource.username =sa
88spring.datasource.password =
@@ -13,9 +13,14 @@ spring.flyway.enabled=false
1313# Disable Redis for tests
1414spring.cache.type =simple
1515
16- # Disable JPA auto-ddl (use schema.sql instead if needed)
16+ # JPA configuration - create tables automatically
1717spring.jpa.hibernate.ddl-auto =create-drop
1818spring.jpa.show-sql =false
19+ spring.jpa.properties.hibernate.format_sql =false
20+ spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.H2Dialect
21+ spring.jpa.properties.hibernate.globally_quoted_identifiers =false
22+ spring.jpa.properties.hibernate.physical_naming_strategy =org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
23+ spring.jpa.properties.hibernate.implicit_naming_strategy =org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
1924
2025# Disable logging for tests
2126logging.level.root =WARN
You can’t perform that action at this time.
0 commit comments