Skip to content

Add testcontainer configuration fixes for task #12#31

Open
DmitriyChernyakSetronica wants to merge 34 commits intomainfrom
task/12-configure-container
Open

Add testcontainer configuration fixes for task #12#31
DmitriyChernyakSetronica wants to merge 34 commits intomainfrom
task/12-configure-container

Conversation

@DmitriyChernyakSetronica
Copy link
Copy Markdown

@DmitriyChernyakSetronica DmitriyChernyakSetronica commented Oct 24, 2025

The original task description below contains a logical typo means reviews instead of product:
This leads to distorted information about the analysis results.
We don't need to touch the review service and anything related to it.

  1. Add a Spring Data entity and a repository for reviews,
  2. Configure a connection to PostgreSQL.
  3. Update docker-compose to run the database in the container.

so task description should be:

  1. Add a Spring Data entity and a repository for the product.
  2. Configure a connection to PostgreSQL.
  3. Update docker-compose to run the database in the container.

Add testcontainer configuration fixes for
Product Service: Introduce PostgreSQL integration and persistence layer #12

  • Configure PostgreSQL in 'docker-compose.yml' and application configurations
  • Add 'ProductEntity' and 'ProductRepository' for database operations
  • Implement CRUD operations in 'ProductServiceImpl'
  • Add API endpoints for product CRUD operations
  • Write test cases using Testcontainers for persistence and API integration

FAIL_TO_PASS: shop.microservices.core.product.PersistenceTests, shop.microservices.core.product.ProductServiceApiTests

dtsaryov and others added 30 commits July 22, 2025 12:44
…er is a non-negative integer

Declare a RestControllerAdvice class to handle API exceptions and return proper responses.
Write tests to check the validation
- Create ServiceUtil for service discovery
- Implement ProductCompositeIntegration and update ProductCompositeService with aggregated responses
- Update tests to check updated behavior
- Configure JPA with MySQL for persistence
- Add `ReviewEntity` and `ReviewRepository` for database operations
- Declare and implement CRUD operations for the 'ReviewService' API endpoint
- Configure MySQL in 'docker-compose.yml'
- Update application properties for local and Docker profiles
- Add integration tests with Testcontainers for API and persistence layer
- Add `spring-boot-starter-validation` dependency to enable bean validation
- Annotate fields in `ReviewEntity` with validation constraints
- Introduce `ReviewValidationTests` to validate `ReviewEntity` constraints
- Add Flyway dependencies to manage DB schema migrations
- Add 'V1__' migration script to create 'reviews' table with constraints
- Add `ReviewDbMigrationTest` to validate Flyway migrations
- Extend `ReviewEntity` with a non-null `date` field
- Update database schema with Flyway migration 'V2__'
- Modify API contract and record `Review` to include `date`
- Adjust validation rules and tests for new field
- Add `LocalDateConverter` for proper `LocalDate` serialization/deserialization
…ayer

- Configure MongoDB Docker container
- Update `docker-compose.yml` to include a MongoDB service with health checks
- Add CRUD operations for recommendation
- Write integration tests with Testcontainers
- Add 'spring-boot-starter-validation' dependency to enable bean validation
- Introduce 'MongoDbValidationConfig' to integrate validation with MongoDB
- Update 'RecommendationEntity' with validation annotations for fields
- Modify tests to include validation scenarios
- Add 'RecommendationValidationTests' to validate entity constraints
… layer

- Configure PostgreSQL in 'docker-compose.yml' and application configurations
- Add 'ProductEntity' and 'ProductRepository' for database operations
- Implement CRUD operations in 'ProductServiceImpl'
- Add API endpoints for product CRUD operations
- Write test cases using Testcontainers for persistence and API integration
…ize schema

- Add Liquibase dependency and initial changelog with 'products' table creation
- Update application configuration to use Liquibase for schema management
- Replace SQL-based initialization with Liquibase
- Add 'ProductMigrationTest' to verify Liquibase migrations with Testcontainers
…delete composite products

- Implement CRUD operations for composite products in `ProductCompositeService`
- Add new endpoints with OpenAPI documentation: POST, DELETE for composite products
- Enhance service layer with integration methods and logging
- Refactor product, recommendations, and reviews retrieval logic
- Update tests with comprehensive cases for new operations
- Remove `MappingUtils` and its usages
- Introduce `ReviewMapper` interface using MapStruct for mapping logic
- Add MapStruct dependency and configuration in `build.gradle`
- Update `ReviewServiceImpl` to use `ReviewMapper` for mapping operations
- Add `ReviewMapperTest` to verify mapping functionality
- Remove `MappingUtils` and its usages
- Introduce `RecommendationMapper` interface using MapStruct for mapping logic
- Add MapStruct dependency and configuration in `build.gradle`
- Update `RecommendationServiceImpl` to use `RecommendationMapper` for mapping operations
- Add `RecommendationMapperTest` to verify mapping functionality
- Remove `MapperUtils` and its usages
- Introduce `ProductMapper` interface using MapStruct for mapping logic
- Add MapStruct dependency and configuration in `build.gradle`
- Update `ProductServiceImpl` to use `ProductMapper` for mapping operations
- Add `ProductMapperTest` to verify mapping functionality
- Replace synchronous RestTemplate with WebClient across microservices
- Refactor repositories to use reactive CRUD operations
- Update service implementations and test cases accordingly
- Transition from traditional MVC to WebFlux stack for all APIs and testing frameworks
- Remove unused synchronous methods, libraries, and dependencies
- Add messaging support across microservices using Spring Cloud Stream with RabbitMQ
- Replace HTTP-based communication with event-driven messaging for create and delete operations
- Add event models and processing logic in `api` module
- Update `ProductCompositeIntegration` to publish and consume events
- Refactor tests and add message-driven test cases for all event-processing scenarios
- Integrate Health Checks for underlying services using Actuator
…tion

- Add Eureka Server module with Spring Cloud Netflix Eureka
- Integrate Eureka client in all microservices for service discovery
- Replace hardcoded service URLs with dynamic resolution through Eureka
- Update WebClient configuration to support load balancing with Eureka
- Refactor configuration files to include Eureka settings
- Modify Docker Compose to include Eureka Server
- Enhance logging and error handling in `ProductCompositeIntegration` for service calls
- Add tests for Eureka Server and client integration
- Introduce 'NotFoundException'
- Update 'ProductServiceImpl' to throw 'NotFoundException' when no product is found
- Modify 'ProductCompositeIntegration' logic to handle `NotFoundException` from downstream services
- Add 'GlobalControllerExceptionHandler' to process `NotFoundException` responses with proper HTTP status
…management-20250726184713

Add workflow: pr-label-management.yml
- Adjust the DTO and the entity to handle the new field
- Add validation for the new field and update tests
- Generate Flyway update scripts
- Update test cases across all services to include and validate the new field
dtsaryov added 3 commits July 28, 2025 15:06
- Update API contracts to define the new '/product-composite/reviews/{productId}' endpoint
- Update OpenAPI documentation to describe the new endpoint
- Include test cases to validate reviews retrieval logic
… associated recommendations and reviews

- Update API contracts to define the new '/product-composite' endpoint
- Implement service method in 'ProductCompositeService' to aggregate product details
- Update 'ProductCompositeIntegration' to call downstream 'ProductService' for all products
- Extend 'ProductService' with a new method and corresponding implementation in 'ProductServiceImpl'
- Add test cases to verify 'getAllProducts' functionality end-to-end
- Introduce constraints for the 'productId,' 'name,' and 'weight' fields
- Update 'ProductServiceImpl' to validate Product entity during save
- Add test cases to verify validation logic in 'ProductValidationTests'
- Enhance API tests to cover invalid Product save scenarios
Product Service: Introduce PostgreSQL integration and persistence layer #12
- Configure PostgreSQL in 'docker-compose.yml' and application configurations
- Add 'ProductEntity' and 'ProductRepository' for database operations
- Implement CRUD operations in 'ProductServiceImpl'
- Add API endpoints for product CRUD operations
- Write test cases using Testcontainers for persistence and API integration

FAIL_TO_PASS: shop.microservices.core.product.PersistenceTests, shop.microservices.core.product.ProductServiceApiTests
@DmitriyChernyakSetronica
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants