Skip to content

Commit e830a6e

Browse files
author
Yuriy Bezsonov
committed
requirements for java25-spring-modernization
1 parent 0ebc6ef commit e830a6e

3 files changed

Lines changed: 26 additions & 10 deletions

File tree

.kiro/specs/java25-spring-modernization/design.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,21 @@ public @interface TestInfrastructure {
366366

367367
```java
368368
/**
369-
* Initializes test infrastructure with Testcontainers.
369+
* Initializes test infrastructure with Testcontainers 2.0.
370370
*
371371
* Features:
372372
* - PostgreSQL container for database
373373
* - LocalStack with CLOUDWATCHEVENTS for EventBridge testing
374374
* - Container reuse for faster test execution
375375
* - H2 fallback when Docker unavailable
376+
*
377+
* Note: Testcontainers 2.0 uses new package structure:
378+
* - org.testcontainers.postgresql.PostgreSQLContainer
379+
* - org.testcontainers.localstack.LocalStackContainer
376380
*/
381+
import org.testcontainers.postgresql.PostgreSQLContainer; // TC 2.0 package
382+
import org.testcontainers.localstack.LocalStackContainer; // TC 2.0 package
383+
377384
public class TestInfrastructureInitializer implements BeforeAllCallback {
378385

379386
private static PostgreSQLContainer<?> postgres;

.kiro/specs/java25-spring-modernization/requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ When a Java/Spring developer sees this application, they should think:
180180

181181
1. THE Application SHALL use AWS SDK version 2.40.14 or later
182182
2. THE Application SHALL NOT require --add-opens JVM flags for test execution
183-
3. THE Application SHALL use Testcontainers version 1.21.4 or later
183+
3. THE Application SHALL use Testcontainers version 2.0.3 or later with updated module coordinates
184184

185185
### Requirement 15: H2 Database Fallback
186186

.kiro/specs/java25-spring-modernization/tasks.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,29 @@ This implementation plan transforms unicorn-store-spring-java25 into a showcase
9999
- Verify application starts correctly
100100
- Ask the user if questions arise
101101

102-
- [ ] 6. Test Infrastructure Simplification
103-
- [ ] 6.1 Create TestInfrastructure annotation
102+
- [ ] 6. Test Infrastructure Simplification and Testcontainers 2.0 Migration
103+
- [ ] 6.1 Update pom.xml for Testcontainers 2.0
104+
- Update testcontainers.version property to 2.0.3
105+
- Update artifact coordinates: `org.testcontainers:postgresql``org.testcontainers:testcontainers-postgresql`
106+
- Update artifact coordinates: `org.testcontainers:localstack``org.testcontainers:testcontainers-localstack`
107+
- Update artifact coordinates: `org.testcontainers:junit-jupiter``org.testcontainers:testcontainers-junit-jupiter`
108+
- _Requirements: 14.3_
109+
110+
- [ ] 6.2 Create TestInfrastructure annotation
104111
- Create `src/test/java/com/unicorn/store/integration/TestInfrastructure.java`
105112
- Combine @ExtendWith with TestInfrastructureInitializer
106113
- _Requirements: 7.1, 7.2_
107114

108-
- [ ] 6.2 Rename and update TestInfrastructureInitializer
115+
- [ ] 6.3 Rename and update TestInfrastructureInitializer for Testcontainers 2.0
109116
- Rename from TestcontainersInfrastructureInitializer if needed
117+
- Update imports: `org.testcontainers.containers.PostgreSQLContainer``org.testcontainers.postgresql.PostgreSQLContainer`
118+
- Update imports: `org.testcontainers.containers.localstack.LocalStackContainer``org.testcontainers.localstack.LocalStackContainer`
110119
- Update LocalStack to use CLOUDWATCHEVENTS service (not S3/DynamoDB)
111120
- Add `.withReuse(true)` for container reuse
112121
- Remove unused `dockerAvailable` variable
113-
- _Requirements: 8.1, 8.3_
122+
- _Requirements: 8.1, 8.3, 14.3_
114123

115-
- [ ] 6.3 Delete redundant test infrastructure files
124+
- [ ] 6.4 Delete redundant test infrastructure files
116125
- Delete `InfrastructureInitializer.java`
117126
- Delete `InitializeInfrastructure.java`
118127
- Delete `InitializeSimpleInfrastructure.java`
@@ -122,18 +131,18 @@ This implementation plan transforms unicorn-store-spring-java25 into a showcase
122131
- Delete `application-test.yaml` if exists
123132
- _Requirements: 7.1_
124133

125-
- [ ] 6.4 Update UnicornControllerTest
134+
- [ ] 6.5 Update UnicornControllerTest
126135
- Replace `@InitializeTestcontainersInfrastructure` with `@TestInfrastructure`
127136
- Remove `@ActiveProfiles("test")` if not needed
128137
- Replace raw `assert` statements with AssertJ assertions
129138
- _Requirements: 7.2, 7.3, 7.4_
130139

131-
- [ ] 6.5 Fix H2 fallback schema
140+
- [ ] 6.6 Fix H2 fallback schema
132141
- Update `src/test/resources/schema.sql` to use `RANDOM_UUID()` instead of `gen_random_uuid()`
133142
- Ensure schema works with both PostgreSQL and H2
134143
- _Requirements: 15.1, 15.2_
135144

136-
- [ ] 6.6 Write property test for JSON serialization
145+
- [ ] 6.7 Write property test for JSON serialization
137146
- **Property 2: JSON Serialization Round-Trip**
138147
- Create `src/test/java/com/unicorn/store/property/UnicornSerializationPropertyTest.java`
139148
- Test serialize → deserialize produces equivalent object

0 commit comments

Comments
 (0)