|
| 1 | +# SD Kotlin Spring Talks Developer Guidelines |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +This is a Spring Boot demonstration project written in Kotlin, showcasing |
| 6 | +various Spring features and best practices. The project uses Gradle as its build |
| 7 | +system and implements modern Kotlin features including Coroutines. |
| 8 | + |
| 9 | +## Project Structure |
| 10 | + |
| 11 | +``` |
| 12 | +sd-kotlin-spring-talks/ |
| 13 | +. |
| 14 | +├── .github/ # GitHub Actions CI workflows |
| 15 | +├── .idea/ # IntelliJ IDEA configuration |
| 16 | +├── build-logic/ # Included build with custom Gradle build logic |
| 17 | +├── gradle/ # Gradle Wrapper configuration and version catalog |
| 18 | +├── subprojects/ |
| 19 | +│ ├── app/ # Main application module |
| 20 | +│ ├── child-context/ # Child context demonstrations |
| 21 | +│ │ ├── domain-service/ |
| 22 | +│ │ └── rest-api/ |
| 23 | +│ ├── component-scanned-service/ # Component scanning examples |
| 24 | +│ ├── custom-resources/ # Custom resource handling |
| 25 | +│ ├── kotlin-json/ # JSON processing |
| 26 | +│ │ ├── jackson/ |
| 27 | +│ │ └── kogera/ |
| 28 | +│ ├── time-logger/ # Time logging functionality |
| 29 | +│ └── time-service/ # Time service implementation |
| 30 | +└── platforms/ # Gradle platform definitions |
| 31 | +``` |
| 32 | + |
| 33 | +## Build & Run |
| 34 | + |
| 35 | +- The project uses Gradle as the build system |
| 36 | +- Build and verify the project (includes unit and integration tests): |
| 37 | + `./gradlew build` |
| 38 | +- Verify dependency configuration: `./gradlew buildHealth` |
| 39 | +- Check for potential dependency updates: `./gradlew dependencyUpdates` |
| 40 | +- Run the application: `./gradlew :subprojects:app:run` |
| 41 | + |
| 42 | +## Testing |
| 43 | + |
| 44 | +- JUnit Jupiter is the primary testing framework |
| 45 | +- AssertJ is used for fluent assertions |
| 46 | +- Mockk is available for mocking |
| 47 | +- Prefer plain Kotlin mocks |
| 48 | +- Use Gradle [test fixtures](https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures) for shared test doubles and utilities |
| 49 | +- Tests are organized into unit (`src/test`) and integration (`src/it`) suites |
| 50 | +- JUnit 5's `@DynamicTest` feature is used for test parameterization |
| 51 | +- Spring's `@SpringBootTest` is used for integration tests |
| 52 | +- Run unit tests: `./gradlew test` |
| 53 | +- Run integration tests: `./gradlew integrationTest` |
| 54 | +- Run all tests: `./gradlew check` |
| 55 | + |
| 56 | +## Version Control |
| 57 | + |
| 58 | +- The primary development branch is `main` |
| 59 | +- Git LFS is used for versioning binaries |
| 60 | + |
| 61 | +## Code Style |
| 62 | + |
| 63 | +- Follow the versioned IntelliJ code style configuration |
| 64 | +- Format all changed code before commit |
| 65 | + |
| 66 | +## Dependencies |
| 67 | + |
| 68 | +- Use the Gradle version catalog and platforms for dependency management |
| 69 | +- The GitHub Actions CI build will fail if `./gradlew buildHealth` does |
| 70 | + |
| 71 | +## Code Quality |
| 72 | + |
| 73 | +- As the project code sometimes contains partial examples, antipattern |
| 74 | + demonstrations, issue reproducers, and uses preview features, it may contain |
| 75 | + many compiler, static analysis, and runtime warnings. No effort is made to |
| 76 | + suppress these with `@Suppress` annotations, as that would excessively |
| 77 | + clutter the examples. |
0 commit comments