├── .gitignore ├── 09-01-result ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradle.properties ├── bin │ ├── main │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ │ └── codely │ │ │ │ ├── Application.kt │ │ │ │ └── config │ │ │ │ └── DatabaseConfig.kt │ │ ├── application.yml │ │ └── application-test.yml │ └── test-integration │ │ ├── db │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── src │ ├── main │ │ ├── resources │ │ │ ├── db │ │ │ │ └── migration │ │ │ │ │ └── V1.0.0__course_table.sql │ │ │ ├── application.yml │ │ │ └── application-test.yml │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DatabaseConfig.kt │ └── test-integration │ │ ├── resources │ │ └── db │ │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── contexts │ └── course │ │ ├── bin │ │ ├── main │ │ │ └── com │ │ │ │ └── codely │ │ │ │ └── course │ │ │ │ └── domain │ │ │ │ └── CourseRepository.kt │ │ └── test │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── BaseTest.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ └── CourseRepository.kt ├── Dockerfile ├── docker-compose-test.yml └── docker-compose.yml ├── 09-02-either ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradle.properties ├── bin │ ├── main │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ │ └── codely │ │ │ │ ├── Application.kt │ │ │ │ └── config │ │ │ │ └── DatabaseConfig.kt │ │ ├── application.yml │ │ └── application-test.yml │ └── test-integration │ │ ├── db │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── src │ ├── main │ │ ├── resources │ │ │ ├── db │ │ │ │ └── migration │ │ │ │ │ └── V1.0.0__course_table.sql │ │ │ ├── application.yml │ │ │ └── application-test.yml │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DatabaseConfig.kt │ └── test-integration │ │ ├── resources │ │ └── db │ │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── contexts │ └── course │ │ ├── bin │ │ ├── main │ │ │ └── com │ │ │ │ └── codely │ │ │ │ └── course │ │ │ │ └── domain │ │ │ │ ├── CourseRepository.kt │ │ │ │ └── CourseError.kt │ │ └── test │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── BaseTest.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseError.kt ├── Dockerfile ├── docker-compose-test.yml ├── common │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── common │ │ │ └── Either.kt │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── common │ │ └── Either.kt └── docker-compose.yml ├── 01-01-healthcheck ├── .gitignore ├── bin │ └── main │ │ └── com │ │ └── codely │ │ ├── course │ │ ├── domain │ │ │ └── .gitkeep │ │ ├── application │ │ │ └── .gitkeep │ │ └── infrastructure │ │ │ └── HealthcheckController.kt │ │ └── shared │ │ └── Application.kt ├── src │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── course │ │ ├── domain │ │ │ └── .gitkeep │ │ ├── application │ │ │ └── .gitkeep │ │ └── infrastructure │ │ │ └── HealthcheckController.kt │ │ └── shared │ │ └── Application.kt ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties └── Dockerfile ├── 02-01-create-course ├── .gitignore ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── infrastructure │ │ │ └── .gitkeep │ │ │ ├── domain │ │ │ ├── CourseRepository.kt │ │ │ └── Course.kt │ │ │ └── application │ │ │ └── CourseCreator.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ ├── domain │ │ ├── CourseRepository.kt │ │ └── Course.kt │ │ └── application │ │ └── CourseCreator.kt ├── settings.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradle.properties ├── bin │ └── main │ │ └── com │ │ └── codely │ │ └── Application.kt ├── src │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── Application.kt └── Dockerfile ├── 05-01-add-repo ├── .env ├── contexts │ └── course │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt ├── settings.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── Dockerfile ├── src │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ ├── DependencyInjectionConf.kt │ │ └── DatabaseConfig.kt └── docker-compose.yml ├── 07-02-rest-assure ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── contexts │ └── course │ │ ├── bin │ │ ├── main │ │ │ └── com │ │ │ │ └── codely │ │ │ │ └── course │ │ │ │ └── domain │ │ │ │ ├── CourseRepository.kt │ │ │ │ └── CourseExceptions.kt │ │ └── test │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── BaseTest.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt ├── bin │ └── main │ │ ├── db │ │ └── migration │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ ├── DependencyInjectionConf.kt │ │ │ └── DatabaseConfig.kt │ │ ├── application.yml │ │ └── application-test.yml ├── src │ └── main │ │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── application.yml │ │ └── application-test.yml │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ ├── DependencyInjectionConf.kt │ │ └── DatabaseConfig.kt ├── Dockerfile ├── docker-compose-test.yml └── docker-compose.yml ├── 10-02-deploy-api ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradle.properties ├── bin │ ├── test-integration │ │ ├── db │ │ │ └── fixtures │ │ │ │ └── find │ │ │ │ └── add-course-data.sql │ │ └── com │ │ │ └── codely │ │ │ └── shared │ │ │ ├── database │ │ │ └── TestConfig.kt │ │ │ └── acceptance │ │ │ └── StringAssertUtils.kt │ └── main │ │ ├── db │ │ └── migration │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DatabaseConfig.kt │ │ ├── application-test.yml │ │ └── application.yml ├── src │ ├── test-integration │ │ ├── resources │ │ │ └── db │ │ │ │ └── fixtures │ │ │ │ └── find │ │ │ │ └── add-course-data.sql │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ └── shared │ │ │ ├── database │ │ │ └── TestConfig.kt │ │ │ └── acceptance │ │ │ └── StringAssertUtils.kt │ └── main │ │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── application-test.yml │ │ └── application.yml │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ └── DatabaseConfig.kt ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── domain │ │ │ └── CourseRepository.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ └── CourseRepository.kt ├── Dockerfile ├── docker-compose-test.yml └── docker-compose.yml ├── 03-02-test-with-clock ├── .gitignore ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── infrastructure │ │ │ └── .gitkeep │ │ │ └── domain │ │ │ └── course │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ └── domain │ │ ├── course │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt │ │ └── Clock.kt ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── bin │ └── main │ │ └── com │ │ └── codely │ │ └── Application.kt ├── src │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── Application.kt └── Dockerfile ├── 06-01-add-controller ├── .env ├── settings.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── contexts │ └── course │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt ├── src │ └── main │ │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── application-test.yml │ │ └── application.yml │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ ├── DependencyInjectionConf.kt │ │ └── DatabaseConfig.kt ├── docker-compose.yml └── Dockerfile ├── 06-02-error-handling ├── .env ├── .gitignore ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── infrastructure │ │ │ └── .gitkeep │ │ │ └── domain │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt ├── settings.gradle.kts ├── img.png ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── bin │ └── main │ │ ├── db │ │ └── migration │ │ │ └── V1.0.0__course_table.sql │ │ ├── application-test.yml │ │ ├── com │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ ├── DependencyInjectionConf.kt │ │ │ └── DatabaseConfig.kt │ │ └── application.yml ├── src │ └── main │ │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── application-test.yml │ │ └── application.yml │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ ├── DependencyInjectionConf.kt │ │ └── DatabaseConfig.kt ├── Dockerfile └── docker-compose.yml ├── 11-01-domain-events ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradle.properties ├── bin │ ├── main │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ │ └── codely │ │ │ │ ├── Application.kt │ │ │ │ └── config │ │ │ │ └── DatabaseConfig.kt │ │ ├── application-test.yml │ │ └── application.yml │ └── test-integration │ │ ├── db │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── src │ ├── main │ │ ├── resources │ │ │ ├── db │ │ │ │ └── migration │ │ │ │ │ └── V1.0.0__course_table.sql │ │ │ ├── application-test.yml │ │ │ └── application.yml │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DatabaseConfig.kt │ └── test-integration │ │ ├── resources │ │ └── db │ │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── common │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── domain │ │ │ ├── Publisher.kt │ │ │ └── DomainEvent.kt │ │ │ └── infrastructure │ │ │ └── InMemoryPublisher.kt │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── domain │ │ ├── Publisher.kt │ │ └── DomainEvent.kt │ │ └── infrastructure │ │ └── InMemoryPublisher.kt ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── domain │ │ │ ├── CourseRepository.kt │ │ │ └── CourseCreated.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseCreated.kt ├── Dockerfile ├── docker-compose-test.yml └── docker-compose.yml ├── 01-02-healthcheck-actuator ├── .gitignore ├── bin │ └── main │ │ └── com │ │ └── codely │ │ ├── course │ │ ├── domain │ │ │ └── .gitkeep │ │ ├── application │ │ │ └── .gitkeep │ │ └── infrastructure │ │ │ └── .gitkeep │ │ └── shared │ │ └── Application.kt ├── settings.gradle.kts ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ └── Application.kt ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties └── Dockerfile ├── 03-01-create-course-with-tests ├── .gitignore ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── infrastructure │ │ │ └── .gitkeep │ │ │ └── domain │ │ │ └── course │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ └── domain │ │ ├── course │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt │ │ └── Clock.kt ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── bin │ └── main │ │ └── com │ │ └── codely │ │ └── Application.kt ├── src │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── Application.kt └── Dockerfile ├── 06-03-controller-unit-test ├── .env ├── .gitignore ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── infrastructure │ │ │ └── .gitkeep │ │ │ └── domain │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt ├── settings.gradle.kts ├── img.png ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── bin │ └── main │ │ ├── db │ │ └── migration │ │ │ └── V1.0.0__course_table.sql │ │ ├── application-test.yml │ │ ├── com │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ ├── DependencyInjectionConf.kt │ │ │ └── DatabaseConfig.kt │ │ └── application.yml ├── src │ └── main │ │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── application-test.yml │ │ └── application.yml │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ ├── DependencyInjectionConf.kt │ │ └── DatabaseConfig.kt ├── Dockerfile └── docker-compose.yml ├── 10-01-graceful-shutdown ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── bin │ ├── main │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ │ └── codely │ │ │ │ ├── Application.kt │ │ │ │ └── config │ │ │ │ └── DatabaseConfig.kt │ │ ├── application-test.yml │ │ └── application.yml │ └── test-integration │ │ ├── db │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── src │ ├── main │ │ ├── resources │ │ │ ├── db │ │ │ │ └── migration │ │ │ │ │ └── V1.0.0__course_table.sql │ │ │ ├── application-test.yml │ │ │ └── application.yml │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DatabaseConfig.kt │ └── test-integration │ │ ├── resources │ │ └── db │ │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── domain │ │ │ └── CourseRepository.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ └── CourseRepository.kt ├── docker-compose-test.yml ├── Dockerfile └── docker-compose.yml ├── 05-03-repository-test ├── .gitignore ├── src │ ├── main │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── codely │ │ │ │ ├── course │ │ │ │ ├── infrastructure │ │ │ │ │ └── .gitkeep │ │ │ │ └── domain │ │ │ │ │ └── course │ │ │ │ │ ├── CourseRepository.kt │ │ │ │ │ └── CourseExceptions.kt │ │ │ │ └── shared │ │ │ │ ├── Application.kt │ │ │ │ └── config │ │ │ │ ├── DependencyInjectionConf.kt │ │ │ │ └── DatabaseConfig.kt │ │ └── resources │ │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ │ ├── application-test.yml │ │ │ └── application.yml │ └── test │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ └── BaseTest.kt ├── contexts │ └── course │ │ └── bin │ │ └── main │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt ├── settings.gradle.kts ├── img.png ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── bin │ └── main │ │ ├── db │ │ └── migration │ │ │ └── V1.0.0__course_table.sql │ │ ├── application-test.yml │ │ ├── com │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ ├── DependencyInjectionConf.kt │ │ │ └── DatabaseConfig.kt │ │ └── application.yml ├── docker-compose.yml └── Dockerfile ├── 08-02-find-application-domain ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── bin │ ├── main │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ │ └── codely │ │ │ │ ├── Application.kt │ │ │ │ └── config │ │ │ │ └── DatabaseConfig.kt │ │ ├── application.yml │ │ └── application-test.yml │ └── test-integration │ │ ├── db │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── src │ ├── main │ │ ├── resources │ │ │ ├── db │ │ │ │ └── migration │ │ │ │ │ └── V1.0.0__course_table.sql │ │ │ ├── application.yml │ │ │ └── application-test.yml │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DatabaseConfig.kt │ └── test-integration │ │ ├── resources │ │ └── db │ │ │ └── fixtures │ │ │ └── find │ │ │ └── add-course-data.sql │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ ├── database │ │ └── TestConfig.kt │ │ └── acceptance │ │ └── StringAssertUtils.kt ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── domain │ │ │ └── CourseRepository.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ └── CourseRepository.kt ├── docker-compose-test.yml ├── Dockerfile └── docker-compose.yml ├── 02-02-create-course-with-validations ├── .gitignore ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── infrastructure │ │ │ └── .gitkeep │ │ │ └── domain │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ ├── infrastructure │ │ └── .gitkeep │ │ ├── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt │ │ └── application │ │ └── CourseCreator.kt ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── Dockerfile ├── bin │ └── main │ │ └── com │ │ └── codely │ │ └── Application.kt └── src │ └── main │ └── kotlin │ └── com │ └── codely │ └── Application.kt ├── 04-01-dependency-injection ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── contexts │ └── course │ │ ├── bin │ │ ├── main │ │ │ └── com │ │ │ │ └── codely │ │ │ │ └── course │ │ │ │ ├── domain │ │ │ │ ├── CourseRepository.kt │ │ │ │ └── CourseExceptions.kt │ │ │ │ └── infrastructure │ │ │ │ └── persistence │ │ │ │ └── InMemoryCourseRepository.kt │ │ └── test │ │ │ └── com │ │ │ └── codely │ │ │ └── BaseTest.kt │ │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── domain │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ │ └── infrastructure │ │ │ └── persistence │ │ │ └── InMemoryCourseRepository.kt │ │ └── test │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── BaseTest.kt ├── bin │ └── main │ │ └── com │ │ └── codely │ │ └── Application.kt ├── src │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── Application.kt └── Dockerfile ├── 07-01-acceptance-tests-springboot ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ └── domain │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt ├── bin │ └── main │ │ ├── db │ │ └── migration │ │ │ └── V1.0.0__course_table.sql │ │ ├── com │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ ├── DependencyInjectionConf.kt │ │ │ └── DatabaseConfig.kt │ │ ├── application.yml │ │ └── application-test.yml ├── src │ └── main │ │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── application.yml │ │ └── application-test.yml │ │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ ├── DependencyInjectionConf.kt │ │ └── DatabaseConfig.kt ├── docker-compose-test.yml ├── Dockerfile └── docker-compose.yml ├── 04-02-manage-config-secrets ├── .gitignore ├── settings.gradle.kts ├── img.png ├── bin │ ├── main │ │ ├── application.yml │ │ └── com │ │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DependencyInjectionConf.kt │ └── test │ │ └── com │ │ └── codely │ │ └── shared │ │ └── BaseTest.kt ├── gradle.properties ├── src │ ├── main │ │ ├── resources │ │ │ └── application.yml │ │ └── kotlin │ │ │ └── com │ │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ └── DependencyInjectionConf.kt │ └── test │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── shared │ │ └── BaseTest.kt ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── contexts │ └── course │ │ ├── bin │ │ └── main │ │ │ └── com │ │ │ └── codely │ │ │ └── course │ │ │ ├── domain │ │ │ ├── CourseRepository.kt │ │ │ └── CourseExceptions.kt │ │ │ └── infrastructure │ │ │ └── persistence │ │ │ └── InMemoryCourseRepository.kt │ │ └── src │ │ └── main │ │ └── kotlin │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt └── Dockerfile └── 08-01-find-course-acceptance-controller ├── .env ├── .gitignore ├── settings.gradle.kts ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── bin ├── main │ ├── db │ │ └── migration │ │ │ └── V1.0.0__course_table.sql │ ├── com │ │ └── codely │ │ │ ├── Application.kt │ │ │ └── config │ │ │ ├── DependencyInjectionConf.kt │ │ │ └── DatabaseConfig.kt │ ├── application.yml │ └── application-test.yml └── test-integration │ ├── db │ └── fixtures │ │ └── find │ │ └── add-course-data.sql │ └── com │ └── codely │ └── shared │ ├── database │ └── TestConfig.kt │ └── acceptance │ └── StringAssertUtils.kt ├── contexts └── course │ ├── bin │ └── main │ │ └── com │ │ └── codely │ │ └── course │ │ └── domain │ │ └── course │ │ ├── CourseRepository.kt │ │ └── CourseExceptions.kt │ └── src │ └── main │ └── kotlin │ └── com │ └── codely │ └── course │ └── domain │ └── course │ ├── CourseRepository.kt │ └── CourseExceptions.kt ├── src ├── main │ ├── resources │ │ ├── db │ │ │ └── migration │ │ │ │ └── V1.0.0__course_table.sql │ │ ├── application.yml │ │ └── application-test.yml │ └── kotlin │ │ └── com │ │ └── codely │ │ ├── Application.kt │ │ └── config │ │ ├── DependencyInjectionConf.kt │ │ └── DatabaseConfig.kt └── test-integration │ ├── resources │ └── db │ │ └── fixtures │ │ └── find │ │ └── add-course-data.sql │ └── kotlin │ └── com │ └── codely │ └── shared │ ├── database │ └── TestConfig.kt │ └── acceptance │ └── StringAssertUtils.kt ├── docker-compose-test.yml ├── Dockerfile └── docker-compose.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | -------------------------------------------------------------------------------- /09-01-result/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /09-02-either/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /01-01-healthcheck/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | -------------------------------------------------------------------------------- /01-01-healthcheck/bin/main/com/codely/course/domain/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /02-01-create-course/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | -------------------------------------------------------------------------------- /05-01-add-repo/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /07-02-rest-assure/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /10-02-deploy-api/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /01-01-healthcheck/bin/main/com/codely/course/application/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-01-healthcheck/src/main/kotlin/com/codely/course/domain/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-02-test-with-clock/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | -------------------------------------------------------------------------------- /06-01-add-controller/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /06-02-error-handling/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /11-01-domain-events/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /01-01-healthcheck/src/main/kotlin/com/codely/course/application/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/bin/main/com/codely/course/domain/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /09-01-result/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /09-02-either/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /10-02-deploy-api/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/bin/main/com/codely/course/application/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-03-repository-test/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /06-02-error-handling/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /07-02-rest-assure/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /08-02-find-application-domain/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /11-01-domain-events/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /01-01-healthcheck/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "01-01-healthcheck" 2 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | -------------------------------------------------------------------------------- /04-01-dependency-injection/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-02-test-with-clock/contexts/course/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /05-01-add-repo/contexts/course/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-03-repository-test/contexts/course/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-03-repository-test/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "05-02-repository-test" 2 | -------------------------------------------------------------------------------- /06-02-error-handling/contexts/course/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/.env: -------------------------------------------------------------------------------- 1 | POSTGRE_URL=db 2 | POSTGRE_PORT=5432 3 | -------------------------------------------------------------------------------- /08-02-find-application-domain/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/contexts/course/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "01-02-healthcheck-actuator" 2 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/contexts/course/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-02-test-with-clock/contexts/course/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06-02-error-handling/contexts/course/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | build 4 | README.md 5 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/contexts/course/bin/main/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/contexts/course/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/contexts/course/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | #management.endpoints.web.exposure.include: "*" 2 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/contexts/course/src/main/kotlin/com/codely/course/infrastructure/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-01-add-repo/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "05-01-add-repo" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /02-01-create-course/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "02-01-create-course" 2 | include("contexts:course") 3 | -------------------------------------------------------------------------------- /07-02-rest-assure/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "06-02-rest-assure" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /06-01-add-controller/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "06-01-add-controller" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /06-02-error-handling/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "06-02-error-handling" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /03-02-test-with-clock/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "03-02-test-with-clock" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /06-02-error-handling/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/06-02-error-handling/img.png -------------------------------------------------------------------------------- /09-01-result/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "07-04-result" 2 | 3 | include("contexts:course") 4 | include("common-test") 5 | -------------------------------------------------------------------------------- /04-01-dependency-injection/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "04-01-dependency-injection" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "03-02-manage-config-secrets" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /05-03-repository-test/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/05-03-repository-test/img.png -------------------------------------------------------------------------------- /06-03-controller-unit-test/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "05-03-controller-unit-test" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "03-01-create-course-with-tests" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /10-02-deploy-api/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "08-02-deploy-api" 2 | 3 | include("contexts:course") 4 | include("common-test") 5 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/04-02-manage-config-secrets/img.png -------------------------------------------------------------------------------- /06-03-controller-unit-test/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/06-03-controller-unit-test/img.png -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "07-01-acceptance-tests-springboot" 2 | 3 | include("contexts:course") 4 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "02-02-create-course-with-validations" 2 | include(":contexts:course") 3 | -------------------------------------------------------------------------------- /09-02-either/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "07-03-either" 2 | 3 | include("contexts:course") 4 | include("common") 5 | include("common-test") 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "08-01-graceful-shutdown" 2 | 3 | include("contexts:course") 4 | include("common-test") 5 | -------------------------------------------------------------------------------- /08-02-find-application-domain/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "07-02-find-application-domain" 2 | 3 | include("contexts:course") 4 | include("common-test") 5 | -------------------------------------------------------------------------------- /05-01-add-repo/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/05-01-add-repo/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /09-01-result/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/09-01-result/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /09-02-either/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/09-02-either/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /11-01-domain-events/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "09-01-domain-events" 2 | 3 | include("contexts:course") 4 | include("common") 5 | include("common-test") 6 | -------------------------------------------------------------------------------- /09-01-result/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /09-02-either/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /10-02-deploy-api/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/10-02-deploy-api/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /01-01-healthcheck/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /01-01-healthcheck/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/01-01-healthcheck/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /02-01-create-course/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/02-01-create-course/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /04-02-manage-config-secrets/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | database.connection: 2 | username: ${DATABASE_USERNAME:empty-username} 3 | password: ${DATABASE_PASSWORD:empty-password} 4 | -------------------------------------------------------------------------------- /07-02-rest-assure/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /07-02-rest-assure/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/07-02-rest-assure/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /10-02-deploy-api/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /11-01-domain-events/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/11-01-domain-events/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /02-01-create-course/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /03-02-test-with-clock/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /03-02-test-with-clock/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/03-02-test-with-clock/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /05-03-repository-test/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /05-03-repository-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/05-03-repository-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /06-01-add-controller/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/06-01-add-controller/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /06-02-error-handling/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /06-02-error-handling/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/06-02-error-handling/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "08-01-find-course-acceptance-controller" 2 | 3 | include("contexts:course") 4 | include("common-test") 5 | -------------------------------------------------------------------------------- /11-01-domain-events/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /04-01-dependency-injection/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | database.connection: 2 | username: ${DATABASE_USERNAME:empty-username} 3 | password: ${DATABASE_PASSWORD:empty-password} 4 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/10-01-graceful-shutdown/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/01-02-healthcheck-actuator/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /03-01-create-course-with-tests/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /04-01-dependency-injection/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/04-01-dependency-injection/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /06-03-controller-unit-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/06-03-controller-unit-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /08-02-find-application-domain/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/04-02-manage-config-secrets/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /07-02-rest-assure/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /08-02-find-application-domain/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/08-02-find-application-domain/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /03-01-create-course-with-tests/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/03-01-create-course-with-tests/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /05-01-add-repo/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /05-03-repository-test/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /06-02-error-handling/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /07-02-rest-assure/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | org.gradle.parallel=true 3 | org.gradle.caching=true 4 | org.gradle.daemon=true 5 | org.gradle.jvmargs=-Xmx1536M 6 | -------------------------------------------------------------------------------- /09-01-result/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /09-01-result/bin/test-integration/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /09-02-either/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /09-02-either/bin/test-integration/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/test-integration/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/kotlin/com/codely/course/domain/course/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /06-01-add-controller/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /06-02-error-handling/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/07-01-acceptance-tests-springboot/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /07-02-rest-assure/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/test-integration/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/02-02-create-course-with-validations/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /05-03-repository-test/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /06-02-error-handling/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /09-01-result/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /09-01-result/src/test-integration/resources/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /09-02-either/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /09-02-either/src/test-integration/resources/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/test-integration/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/test-integration/resources/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /03-02-test-with-clock/contexts/course/bin/main/com/codely/course/domain/course/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /07-02-rest-assure/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodelyTV/kotlin-hexagonal_http_api-course/HEAD/08-01-find-course-acceptance-controller/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/test-integration/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /11-01-domain-events/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /11-01-domain-events/src/test-integration/resources/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/contexts/course/bin/main/com/codely/course/domain/course/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /03-02-test-with-clock/contexts/course/src/main/kotlin/com/codely/course/domain/course/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /06-01-add-controller/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /06-02-error-handling/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/test-integration/resources/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /03-02-test-with-clock/contexts/course/src/main/kotlin/com/codely/course/domain/Clock.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | 5 | interface Clock { 6 | fun now(): LocalDateTime 7 | } 8 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/main/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/test-integration/resources/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36Z'); 2 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/contexts/course/src/main/kotlin/com/codely/course/domain/course/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/test-integration/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36.155Z'); 2 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/contexts/course/bin/main/com/codely/course/domain/course/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/contexts/course/src/main/kotlin/com/codely/course/domain/Clock.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | 5 | interface Clock { 6 | fun now(): LocalDateTime 7 | } 8 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/main/resources/db/migration/V1.0.0__course_table.sql: -------------------------------------------------------------------------------- 1 | create table if not exists course( 2 | id varchar(64) primary key, 3 | name varchar(255) not null, 4 | created_at TIMESTAMP not null 5 | ); 6 | -------------------------------------------------------------------------------- /09-01-result/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/contexts/course/src/main/kotlin/com/codely/course/domain/course/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | } 6 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/test-integration/resources/db/fixtures/find/add-course-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO course(id, name, created_at) VALUES ('f2fe1e4e-1e8f-493b-ac67-2c88090cae0a', 'Saved course', '2022-08-31T09:07:36.155Z'); 2 | -------------------------------------------------------------------------------- /10-02-deploy-api/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /08-02-find-application-domain/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Course? 6 | } 7 | -------------------------------------------------------------------------------- /09-01-result/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /11-01-domain-events/common/bin/main/com/codely/course/domain/Publisher.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface Publisher { 4 | fun publish(events: List) 5 | fun get(): List 6 | fun flush() 7 | } 8 | -------------------------------------------------------------------------------- /11-01-domain-events/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /10-02-deploy-api/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /11-01-domain-events/common/src/main/kotlin/com/codely/course/domain/Publisher.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface Publisher { 4 | fun publish(events: List) 5 | fun get(): List 6 | fun flush() 7 | } 8 | -------------------------------------------------------------------------------- /11-01-domain-events/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /08-02-find-application-domain/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Course? 6 | } 7 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | interface CourseRepository { 4 | fun save(course: Course) 5 | fun find(id: CourseId): Result 6 | } 7 | -------------------------------------------------------------------------------- /09-01-result/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /09-02-either/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /01-01-healthcheck/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /05-01-add-repo/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /07-02-rest-assure/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /10-02-deploy-api/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /02-01-create-course/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /03-02-test-with-clock/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /05-03-repository-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /06-01-add-controller/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /06-02-error-handling/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /11-01-domain-events/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /04-01-dependency-injection/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /08-02-find-application-domain/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /09-01-result/bin/test-integration/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /09-02-either/bin/test-integration/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /09-01-result/src/test-integration/kotlin/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /09-02-either/contexts/course/bin/main/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import com.codely.common.Either 4 | 5 | interface CourseRepository { 6 | fun save(course: Course) 7 | fun find(id: CourseId): Either 8 | } 9 | -------------------------------------------------------------------------------- /09-02-either/src/test-integration/kotlin/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/test-integration/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/test-integration/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/test-integration/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/test-integration/kotlin/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/test-integration/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /09-02-either/contexts/course/src/main/kotlin/com/codely/course/domain/CourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import com.codely.common.Either 4 | 5 | interface CourseRepository { 6 | fun save(course: Course) 7 | fun find(id: CourseId): Either 8 | } 9 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/test-integration/kotlin/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /11-01-domain-events/src/test-integration/kotlin/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/bin/main/com/codely/course/domain/Course.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | import java.util.UUID 5 | 6 | data class Course( 7 | val id: UUID, 8 | val name: String, 9 | val createdAt: LocalDateTime 10 | ) 11 | -------------------------------------------------------------------------------- /06-02-error-handling/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | open-in-view: false 9 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/test-integration/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/test-integration/kotlin/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/src/main/kotlin/com/codely/course/domain/Course.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | import java.util.UUID 5 | 6 | data class Course( 7 | val id: UUID, 8 | val name: String, 9 | val createdAt: LocalDateTime 10 | ) 11 | -------------------------------------------------------------------------------- /05-03-repository-test/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | open-in-view: false 9 | -------------------------------------------------------------------------------- /06-01-add-controller/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | open-in-view: false 9 | -------------------------------------------------------------------------------- /06-02-error-handling/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | open-in-view: false 9 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | open-in-view: false 9 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/test-integration/kotlin/com/codely/shared/database/TestConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.database 2 | 3 | import org.springframework.context.annotation.Bean 4 | 5 | class TestConfig { 6 | 7 | @Bean 8 | fun postgresTestUtils() = PostgresTestUtils() 9 | } 10 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | open-in-view: false 9 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | open-in-view: false 9 | -------------------------------------------------------------------------------- /05-03-repository-test/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | 5 | db: 6 | image: postgres 7 | restart: always 8 | environment: 9 | POSTGRES_USER: course_username 10 | POSTGRES_PASSWORD: course_password 11 | POSTGRES_DB: course_database 12 | ports: 13 | - "5432:5432" 14 | -------------------------------------------------------------------------------- /09-01-result/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/07-04-result-0.0.1.jar . 11 | CMD ["java", "-jar", "07-04-result-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /09-02-either/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/07-03-either-0.0.1.jar . 11 | CMD ["java", "-jar", "07-03-either-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /05-01-add-repo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/05-01-add-repo-0.0.1.jar . 11 | CMD ["java", "-jar", "05-01-add-repo-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /09-01-result/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /09-02-either/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /02-01-create-course/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /03-02-test-with-clock/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /05-01-add-repo/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /07-02-rest-assure/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /09-01-result/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /09-02-either/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /10-02-deploy-api/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/08-02-deploy-ap-0.0.1.jar . 11 | CMD ["java", "-jar", "08-02-deploy-api-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /11-01-domain-events/common/bin/main/com/codely/course/domain/DomainEvent.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | import java.util.UUID 5 | 6 | open class DomainEvent(val type: String, val payload: String) { 7 | private val id = UUID.randomUUID() 8 | private val occurredOn = LocalDateTime.now() 9 | } 10 | -------------------------------------------------------------------------------- /02-01-create-course/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /04-01-dependency-injection/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /06-01-add-controller/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /07-02-rest-assure/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/06-02-rest-assure-0.0.1.jar . 11 | CMD ["java", "-jar", "06-02-rest-assure-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /07-02-rest-assure/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /09-01-result/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /09-02-either/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /11-01-domain-events/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /01-01-healthcheck/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/01-01-healthcheck-0.0.1.jar . 11 | CMD ["java", "-jar", "01-01-healthcheck-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /03-02-test-with-clock/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /07-02-rest-assure/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /10-02-deploy-api/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /11-01-domain-events/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/09-01-domain-events-0.0.1.jar . 11 | CMD ["java", "-jar", "09-01-domain-events-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /11-01-domain-events/common/src/main/kotlin/com/codely/course/domain/DomainEvent.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | import java.util.UUID 5 | 6 | open class DomainEvent(val type: String, val payload: String) { 7 | private val id = UUID.randomUUID() 8 | private val occurredOn = LocalDateTime.now() 9 | } 10 | -------------------------------------------------------------------------------- /11-01-domain-events/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /02-01-create-course/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/02-01-create-course-0.0.1.jar . 11 | CMD ["java", "-jar", "02-01-create-course-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /04-01-dependency-injection/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /06-02-error-handling/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/06-02-error-handling-0.0.1.jar . 11 | CMD ["java", "-jar", "06-02-error-handling-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /03-02-test-with-clock/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/03-02-test-with-clock-0.0.1.jar . 11 | CMD ["java", "-jar", "03-02-test-with-clock-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /05-03-repository-test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/04-02-repository-test-0.0.1.jar . 11 | CMD ["java", "-jar", "04-02-repository-test-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /06-01-add-controller/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/05-01-add-controller-0.0.1.jar . 11 | CMD ["java", "-jar", "05-01-add-controller-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /08-02-find-application-domain/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/08-01-graceful-shutdown-0.0.1.jar . 11 | CMD ["java", "-jar", "08-01-graceful-shutdown-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/src/main/kotlin/com/codely/shared/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | @SpringBootApplication 7 | class Application 8 | 9 | fun main(args: Array) { 10 | runApplication(*args) 11 | } 12 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/05-03-controller-unit-test-0.0.1.jar . 11 | CMD ["java", "-jar", "05-03-controller-unit-test-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/docker-compose-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | 15 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/01-02-healthcheck-actuator-0.0.1.jar . 11 | CMD ["java", "-jar", "01-02-healthcheck-actuator-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /04-01-dependency-injection/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/04-01-dependency-injection-0.0.1.jar . 11 | CMD ["java", "-jar", "04-01-dependency-injection-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/03-02-manage-config-secrets-0.0.1.jar . 11 | CMD ["java", "-jar", "03-02-manage-config-secrets-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /08-02-find-application-domain/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/07-02-find-application-domain-0.0.1.jar . 11 | CMD ["java", "-jar", "07-02-find-application-domain-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/03-01-create-course-with-tests-0.0.1.jar . 11 | CMD ["java", "-jar", "03-01-create-course-with-tests-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/07-01-acceptance-tests-springboot-0.0.1.jar . 11 | CMD ["java", "-jar", "07-01-acceptance-tests-springboot-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle build 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/02-02-create-course-with-validations-0.0.1.jar . 11 | CMD ["java", "-jar", "02-02-create-course-with-validations-0.0.1.jar"] 12 | 13 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gradle:7.5.0-jdk11-alpine as builder 2 | USER root 3 | WORKDIR /builder 4 | ADD . /builder 5 | RUN gradle assemble 6 | 7 | FROM openjdk:11.0.16-jre-slim 8 | WORKDIR /app 9 | EXPOSE 8080 10 | COPY --from=builder /builder/build/libs/08-01-find-course-acceptance-controller-0.0.1.jar . 11 | CMD ["java", "-jar", "08-01-find-course-acceptance-controller-0.0.1.jar"] 12 | -------------------------------------------------------------------------------- /09-01-result/bin/test-integration/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /09-02-either/bin/test-integration/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/test-integration/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /09-01-result/src/test-integration/kotlin/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /09-02-either/contexts/course/bin/main/com/codely/course/domain/CourseError.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseError(message: String) : Error() 4 | 5 | data class CourseNotFoundError(val id: CourseId) : CourseError("The course with id <${id.value}> was not found") 6 | data class CourseCannotBeFoundError(val id: CourseId) : CourseError("Something went wrong trying to find a course with id <${id.value}>") 7 | -------------------------------------------------------------------------------- /09-02-either/src/test-integration/kotlin/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/test-integration/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /09-02-either/contexts/course/src/main/kotlin/com/codely/course/domain/CourseError.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseError(message: String) : Error() 4 | 5 | data class CourseNotFoundError(val id: CourseId) : CourseError("The course with id <${id.value}> was not found") 6 | data class CourseCannotBeFoundError(val id: CourseId) : CourseError("Something went wrong trying to find a course with id <${id.value}>") 7 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/test-integration/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/test-integration/kotlin/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /11-01-domain-events/src/test-integration/kotlin/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/petscare" 4 | username: petscare 5 | password: ${POSTGRE_PASSWORD:petscare} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/test-integration/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/test-integration/kotlin/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/bin/main/com/codely/course/infrastructure/persistence/InMemoryCourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.infrastructure.persistence 2 | 3 | import com.codely.course.domain.Course 4 | import com.codely.course.domain.CourseRepository 5 | 6 | class InMemoryCourseRepository() : CourseRepository { 7 | override fun save(course: Course) { 8 | TODO("Not yet implemented") 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/test-integration/kotlin/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/src/main/kotlin/com/codely/course/infrastructure/persistence/InMemoryCourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.infrastructure.persistence 2 | 3 | import com.codely.course.domain.Course 4 | import com.codely.course.domain.CourseRepository 5 | 6 | class InMemoryCourseRepository() : CourseRepository { 7 | override fun save(course: Course) { 8 | TODO("Not yet implemented") 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /05-03-repository-test/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/test-integration/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /06-02-error-handling/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/test-integration/kotlin/com/codely/shared/acceptance/StringAssertUtils.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.acceptance 2 | 3 | import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper 4 | import kotlin.test.assertEquals 5 | 6 | fun String.isEqualToJson(expected: String) { 7 | val objectMapper = jacksonObjectMapper() 8 | assertEquals(objectMapper.readTree(expected), objectMapper.readTree(this)) 9 | } 10 | -------------------------------------------------------------------------------- /01-01-healthcheck/bin/main/com/codely/shared/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /06-01-add-controller/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely.*") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /09-01-result/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /09-02-either/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/bin/main/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /07-02-rest-assure/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /01-01-healthcheck/src/main/kotlin/com/codely/shared/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /01-02-healthcheck-actuator/bin/main/com/codely/shared/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /05-03-repository-test/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/kotlin/com/codely/shared/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /09-01-result/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /09-01-result/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /09-02-either/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /09-02-either/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/src/main/kotlin/com/codely/Application.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | import org.springframework.context.annotation.ComponentScan 6 | 7 | @SpringBootApplication 8 | @ComponentScan("com.codely") 9 | class Application 10 | 11 | fun main(args: Array) { 12 | runApplication(*args) 13 | } 14 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /07-02-rest-assure/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /07-02-rest-assure/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /06-01-add-controller/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /06-02-error-handling/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /09-01-result/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /09-02-either/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /01-01-healthcheck/bin/main/com/codely/course/infrastructure/HealthcheckController.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.infrastructure 2 | 3 | import org.springframework.web.bind.annotation.GetMapping 4 | import org.springframework.web.bind.annotation.ResponseBody 5 | import org.springframework.web.bind.annotation.RestController 6 | 7 | @RestController 8 | class HealthcheckController { 9 | 10 | @GetMapping("/health-check") 11 | @ResponseBody 12 | fun execute() = "OK" 13 | } 14 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /07-02-rest-assure/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /11-01-domain-events/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /01-01-healthcheck/src/main/kotlin/com/codely/course/infrastructure/HealthcheckController.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.infrastructure 2 | 3 | import org.springframework.web.bind.annotation.GetMapping 4 | import org.springframework.web.bind.annotation.ResponseBody 5 | import org.springframework.web.bind.annotation.RestController 6 | 7 | @RestController 8 | class HealthcheckController { 9 | 10 | @GetMapping("/health-check") 11 | @ResponseBody 12 | fun execute() = "OK" 13 | } 14 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/main/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 4 | username: ${POSTGRE_USERNAME:course_username} 5 | password: ${POSTGRE_PASSWORD:course_password} 6 | jpa: 7 | properties: 8 | hibernate: 9 | dialect: org.hibernate.dialect.PostgreSQLDialect 10 | hibernate: 11 | ddl-auto: validate 12 | open-in-view: false 13 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:tc:postgresql:14.5:///course_database 4 | username: course_username 5 | password: course_password 6 | driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | 15 | -------------------------------------------------------------------------------- /07-02-rest-assure/bin/main/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /05-01-add-repo/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /05-03-repository-test/bin/main/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/bin/main/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/bin/main/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /06-01-add-controller/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/bin/main/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /07-02-rest-assure/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/bin/main/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /07-02-rest-assure/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /05-01-add-repo/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /05-03-repository-test/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /07-02-rest-assure/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/main/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.course.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/contexts/course/src/main/kotlin/com/codely/course/application/CourseCreator.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.application 2 | 3 | import com.codely.course.domain.Course 4 | import com.codely.course.domain.CourseRepository 5 | import java.time.LocalDateTime 6 | 7 | class CourseCreator(private val repository: CourseRepository) { 8 | 9 | fun create(id: String, name: String) { 10 | Course.from(id, name, LocalDateTime.now()).let { 11 | repository.save(it) 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/kotlin/com/codely/course/domain/course/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/kotlin/com/codely/shared/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.course.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /06-01-add-controller/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /06-02-error-handling/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /11-01-domain-events/contexts/course/bin/main/com/codely/course/domain/CourseCreated.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | 5 | data class CourseCreated( 6 | val courseId: CourseId, 7 | val courseName: CourseName, 8 | val createdAt: LocalDateTime 9 | ) : DomainEvent( 10 | type = "CourseCreated", 11 | payload = """ 12 | { 13 | "id": ${courseId.value}, 14 | "name": ${courseName.value}, 15 | "created_at": $createdAt 16 | } 17 | """.trimIndent() 18 | ) 19 | -------------------------------------------------------------------------------- /03-02-test-with-clock/contexts/course/bin/main/com/codely/course/domain/course/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/main/kotlin/com/codely/config/DependencyInjectionConf.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.application.CourseCreator 4 | import com.codely.course.domain.course.CourseRepository 5 | import org.springframework.context.annotation.Bean 6 | import org.springframework.context.annotation.Configuration 7 | 8 | @Configuration 9 | class DependencyInjectionConf { 10 | 11 | @Bean 12 | fun courseCreator(courseRepository: CourseRepository) = CourseCreator(courseRepository) 13 | } 14 | -------------------------------------------------------------------------------- /09-02-either/common/bin/main/com/codely/common/Either.kt: -------------------------------------------------------------------------------- 1 | package com.codely.common 2 | 3 | sealed class Either { 4 | 5 | abstract fun fold(ifLeft: (L) -> C, ifRight: (R) -> C): C 6 | } 7 | 8 | data class Right(val value: R) : Either() { 9 | override fun fold(ifLeft: (Nothing) -> C, ifRight: (R) -> C): C = ifRight(value) 10 | } 11 | 12 | data class Left(val value: L) : Either() { 13 | override fun fold(ifLeft: (L) -> C, ifRight: (Nothing) -> C): C = ifLeft(value) 14 | } 15 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | server.shutdown: graceful 2 | spring: 3 | datasource: 4 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 5 | username: ${POSTGRE_USERNAME:course_username} 6 | password: ${POSTGRE_PASSWORD:course_password} 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | lifecycle: 15 | timeout-per-shutdown-phase: 10s 16 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/contexts/course/bin/main/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /09-01-result/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /09-02-either/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | server.shutdown: graceful 2 | spring: 3 | datasource: 4 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 5 | username: ${POSTGRE_USERNAME:course_username} 6 | password: ${POSTGRE_PASSWORD:course_password} 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | lifecycle: 15 | timeout-per-shutdown-phase: 10s 16 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/main/application.yml: -------------------------------------------------------------------------------- 1 | server.shutdown: graceful 2 | spring: 3 | datasource: 4 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 5 | username: ${POSTGRE_USERNAME:course_username} 6 | password: ${POSTGRE_PASSWORD:course_password} 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | lifecycle: 15 | timeout-per-shutdown-phase: 10s 16 | -------------------------------------------------------------------------------- /11-01-domain-events/contexts/course/src/main/kotlin/com/codely/course/domain/CourseCreated.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | import java.time.LocalDateTime 4 | 5 | data class CourseCreated( 6 | val courseId: CourseId, 7 | val courseName: CourseName, 8 | val createdAt: LocalDateTime 9 | ) : DomainEvent( 10 | type = "CourseCreated", 11 | payload = """ 12 | { 13 | "id": ${courseId.value}, 14 | "name": ${courseName.value}, 15 | "created_at": $createdAt 16 | } 17 | """.trimIndent() 18 | ) 19 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/bin/main/com/codely/course/application/CourseCreator.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.application 2 | 3 | import com.codely.course.domain.Course 4 | import com.codely.course.domain.CourseRepository 5 | import java.time.LocalDateTime 6 | import java.util.UUID 7 | 8 | class CourseCreator(private val repository: CourseRepository) { 9 | 10 | fun create(id: String, name: String) { 11 | Course(UUID.fromString(id), name, LocalDateTime.now()).let { 12 | repository.save(it) 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /02-02-create-course-with-validations/contexts/course/src/main/kotlin/com/codely/course/domain/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/contexts/course/bin/main/com/codely/course/domain/course/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /03-02-test-with-clock/contexts/course/src/main/kotlin/com/codely/course/domain/course/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /07-02-rest-assure/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /09-01-result/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /09-02-either/common/src/main/kotlin/com/codely/common/Either.kt: -------------------------------------------------------------------------------- 1 | package com.codely.common 2 | 3 | sealed class Either { 4 | 5 | abstract fun fold(ifLeft: (L) -> C, ifRight: (R) -> C): C 6 | } 7 | 8 | data class Right(val value: R) : Either() { 9 | override fun fold(ifLeft: (Nothing) -> C, ifRight: (R) -> C): C = ifRight(value) 10 | } 11 | 12 | data class Left(val value: L) : Either() { 13 | override fun fold(ifLeft: (L) -> C, ifRight: (Nothing) -> C): C = ifLeft(value) 14 | } 15 | -------------------------------------------------------------------------------- /09-02-either/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /10-02-deploy-api/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server.shutdown: graceful 2 | spring: 3 | datasource: 4 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 5 | username: ${POSTGRE_USERNAME:course_username} 6 | password: ${POSTGRE_PASSWORD:course_password} 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | lifecycle: 15 | timeout-per-shutdown-phase: 10s 16 | -------------------------------------------------------------------------------- /11-01-domain-events/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /02-01-create-course/contexts/course/src/main/kotlin/com/codely/course/application/CourseCreator.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.application 2 | 3 | import com.codely.course.domain.Course 4 | import com.codely.course.domain.CourseRepository 5 | import java.time.LocalDateTime 6 | import java.util.UUID 7 | 8 | class CourseCreator(private val repository: CourseRepository) { 9 | 10 | fun create(id: String, name: String) { 11 | Course(UUID.fromString(id), name, LocalDateTime.now()).let { 12 | repository.save(it) 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /05-01-add-repo/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /05-01-add-repo/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /05-03-repository-test/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /07-02-rest-assure/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /09-01-result/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /09-02-either/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server.shutdown: graceful 2 | spring: 3 | datasource: 4 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 5 | username: ${POSTGRE_USERNAME:course_username} 6 | password: ${POSTGRE_PASSWORD:course_password} 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | lifecycle: 15 | timeout-per-shutdown-phase: 10s 16 | -------------------------------------------------------------------------------- /10-02-deploy-api/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /11-01-domain-events/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server.shutdown: graceful 2 | spring: 3 | datasource: 4 | url: "jdbc:postgresql://${POSTGRE_URL:localhost}:${POSTGRE_PORT:5432}/course_database" 5 | username: ${POSTGRE_USERNAME:course_username} 6 | password: ${POSTGRE_PASSWORD:course_password} 7 | jpa: 8 | properties: 9 | hibernate: 10 | dialect: org.hibernate.dialect.PostgreSQLDialect 11 | hibernate: 12 | ddl-auto: validate 13 | open-in-view: false 14 | lifecycle: 15 | timeout-per-shutdown-phase: 10s 16 | -------------------------------------------------------------------------------- /03-01-create-course-with-tests/contexts/course/src/main/kotlin/com/codely/course/domain/course/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /06-01-add-controller/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /07-02-rest-assure/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/contexts/course/bin/main/com/codely/course/domain/course/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /08-02-find-application-domain/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /10-02-deploy-api/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /11-01-domain-events/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /11-01-domain-events/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /06-02-error-handling/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/contexts/course/src/main/kotlin/com/codely/course/domain/course/CourseExceptions.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.domain.course 2 | 3 | sealed class CourseException(override val message: String, override val cause: Throwable? = null) : RuntimeException(message, cause) 4 | 5 | data class InvalidCourseIdException(val id: String, override val cause: Throwable?) : CourseException("The id <$id> is not a valid course id", cause) 6 | data class InvalidCourseNameException(val name: String) : CourseException("The name <$name> is not a valid course name") 7 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /10-01-graceful-shutdown/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/contexts/course/bin/main/com/codely/course/infrastructure/persistence/InMemoryCourseRepository.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.infrastructure.persistence 2 | 3 | import com.codely.course.domain.Course 4 | import com.codely.course.domain.CourseRepository 5 | 6 | class DatabaseConnectionData(var username: String = "", var password: String = "") 7 | 8 | class InMemoryCourseRepository(connectionData: DatabaseConnectionData) : CourseRepository { 9 | 10 | override fun save(course: Course) { 11 | TODO("Not yet implemented") 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /06-03-controller-unit-test/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/bin/main/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /08-02-find-application-domain/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /08-02-find-application-domain/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /05-03-repository-test/src/main/kotlin/com/codely/shared/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /07-01-acceptance-tests-springboot/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | db: 4 | image: postgres 5 | restart: always 6 | environment: 7 | POSTGRES_USER: course_username 8 | POSTGRES_PASSWORD: course_password 9 | POSTGRES_DB: course_database 10 | ports: 11 | - "5432:5432" 12 | expose: 13 | - 5432 14 | application: 15 | build: . 16 | container_name: kotlin_course 17 | ports: 18 | - "8080:8080" 19 | depends_on: 20 | - db 21 | expose: 22 | - 8080 23 | env_file: 24 | - .env 25 | -------------------------------------------------------------------------------- /08-01-find-course-acceptance-controller/src/main/kotlin/com/codely/config/DatabaseConfig.kt: -------------------------------------------------------------------------------- 1 | package com.codely.config 2 | 3 | import com.codely.course.infrastructure.persistence.PostgreCourseRepository 4 | import org.springframework.context.annotation.Bean 5 | import org.springframework.context.annotation.Configuration 6 | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate 7 | 8 | @Configuration 9 | class DatabaseConfig { 10 | 11 | @Bean 12 | fun courseRepository(jdbcTemplate: NamedParameterJdbcTemplate) = PostgreCourseRepository(jdbcTemplate) 13 | } 14 | -------------------------------------------------------------------------------- /11-01-domain-events/common/bin/main/com/codely/course/infrastructure/InMemoryPublisher.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.infrastructure 2 | 3 | import com.codely.course.domain.DomainEvent 4 | import com.codely.course.domain.Publisher 5 | 6 | class InMemoryPublisher : Publisher { 7 | private val events = mutableListOf() 8 | override fun publish(data: List) { 9 | events += data 10 | } 11 | 12 | override fun get(): List { 13 | return events 14 | } 15 | 16 | override fun flush() { 17 | events.clear() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /11-01-domain-events/common/src/main/kotlin/com/codely/course/infrastructure/InMemoryPublisher.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course.infrastructure 2 | 3 | import com.codely.course.domain.DomainEvent 4 | import com.codely.course.domain.Publisher 5 | 6 | class InMemoryPublisher : Publisher { 7 | private val events = mutableListOf() 8 | override fun publish(data: List) { 9 | events += data 10 | } 11 | 12 | override fun get(): List { 13 | return events 14 | } 15 | 16 | override fun flush() { 17 | events.clear() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/bin/test/com/codely/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/bin/test/com/codely/shared/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /05-03-repository-test/src/test/kotlin/com/codely/shared/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /09-01-result/contexts/course/bin/test/com/codely/course/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /09-02-either/contexts/course/bin/test/com/codely/course/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /04-01-dependency-injection/contexts/course/src/test/kotlin/com/codely/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /04-02-manage-config-secrets/src/test/kotlin/com/codely/shared/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely.shared 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /07-02-rest-assure/contexts/course/bin/test/com/codely/course/BaseTest.kt: -------------------------------------------------------------------------------- 1 | package com.codely.course 2 | 3 | import io.mockk.every 4 | import io.mockk.mockkStatic 5 | import io.mockk.unmockkAll 6 | import java.time.LocalDateTime 7 | import org.junit.jupiter.api.AfterEach 8 | 9 | open class BaseTest { 10 | 11 | protected fun givenFixedDate(fixedDatetime: LocalDateTime) { 12 | mockkStatic(LocalDateTime::class) 13 | every { 14 | LocalDateTime.now() 15 | } returns fixedDatetime 16 | } 17 | 18 | @AfterEach 19 | protected fun cleanMock() { 20 | unmockkAll() 21 | } 22 | } 23 | --------------------------------------------------------------------------------