@@ -29,37 +29,21 @@ docker/ # Docker image build
2929
3030## DO / DON'T
3131
32+ > For Kotlin idioms and naming conventions, see ** [ docs/KOTLIN.md] ( docs/KOTLIN.md ) ** .
33+ > For Spring Boot patterns and testing setup, see ** [ docs/SPRING.md] ( docs/SPRING.md ) ** .
34+ > For testing conventions and commands, see ** [ docs/TESTING.md] ( docs/TESTING.md ) ** .
35+
3236### DO
33- - Use ** constructor injection** for all Spring beans (in production code)
3437- Use ** data classes** for DTOs with Jackson XML annotations
35- - Use ** Kotlin stdlib** and built-in language features over third-party utilities
3638- Use ** AWS SDK v2** for all new integration tests
3739- Use ** JUnit 5** for all new tests
38- - Use ** ` @SpringBootTest ` ** with ** ` @MockitoBean ` ** for unit tests — this is the project's standard mocking approach
39- - Use ** expression bodies** for simple functions
40- - Use ** null safety** (` ? ` , ` ?. ` , ` ?: ` ) instead of null checks
41- - ** Name the ` it ` parameter** in nested lambdas, loops, and scope functions to avoid shadowing: ` .map { part -> ... } ` instead of ` .map { it.name } `
42- - Match ** AWS S3 API naming exactly** in Jackson XML annotations (` localName = "..." ` )
43- - Keep tests ** independent** — each test creates its own resources (UUID bucket names)
44- - Use ** backtick test names** with descriptive sentences: `` fun `should create bucket successfully`() ``
45- - Mark test classes as ** ` internal ` ** : ` internal class ObjectServiceTest `
46- - ** Refactor** legacy ` testSomething ` camelCase names to backtick style when touching existing tests
4740- ** Update the copyright year** in the file's license header to the current year whenever you modify an existing file
4841- Validate XML serialization against [ AWS S3 API documentation] ( https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html )
4942
5043### DON'T
51- - DON'T use ` @Autowired ` or field injection in production code — always use constructor injection
52- - DON'T use ` var ` for public API properties — prefer ` val ` (immutability)
5344- DON'T use AWS SDK v1 — it has been removed in 5.x
5445- DON'T use JUnit 4 — it has been removed in 5.x
55- - DON'T use ` @ExtendWith(MockitoExtension::class) ` or ` @Mock ` / ` @InjectMocks ` — use ` @SpringBootTest ` with ` @MockitoBean ` instead
56- - DON'T add Apache Commons dependencies — use Kotlin stdlib equivalents
57- - DON'T put business logic in controllers — controllers only map HTTP, delegate to services
58- - DON'T return raw strings from controllers — use typed DTOs for XML/JSON responses
5946- DON'T declare dependency versions in sub-module POMs — all versions are managed in root ` pom.xml `
60- - DON'T share mutable state between tests — each test must be self-contained
61- - DON'T hardcode bucket names in tests — use ` UUID.randomUUID() ` for uniqueness
62- - DON'T use legacy ` testSomething ` camelCase naming for new tests — use backtick names instead
6347- DON'T update copyright years in files you haven't modified — copyright is only bumped when a file is actually changed
6448
6549## Code Style
@@ -105,7 +89,7 @@ Environment variables (prefix: `COM_ADOBE_TESTING_S3MOCK_STORE_`):
10589
10690Services throw ` S3Exception ` constants (` NO_SUCH_BUCKET ` , ` NO_SUCH_KEY ` , ` INVALID_BUCKET_NAME ` , etc.).
10791Spring exception handlers convert them to XML ` ErrorResponse ` with the correct HTTP status.
108- See ` server/AGENTS.md ` for details .
92+ See ** [ docs/SPRING.md ] ( docs/SPRING.md ) ** for exception handling patterns and ` server/AGENTS.md ` for the concrete handler classes .
10993
11094## Testing
11195
0 commit comments