Add cross-service integration tests for Order → Product → Notification flow#77
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
…n flow - Implement Product service CRUD (entity, repository, controller with POST/GET) - Implement Order service with product validation via HTTP and event publishing to Notification service - Fix csproj Shared reference paths across all 5 services (..\..\Shared → ..\..\..\Shared) - Add docker-compose.integration.yml with health checks for test orchestration - Add xUnit integration test project (16 tests covering full flow): * Product creation and retrieval * Order placement with product validation * Notification event propagation verification * Product existence validation before order acceptance * Error scenarios: non-existent product, invalid customer, invalid quantity * Full E2E multi-order flow with distinct notifications - Install curl in service Dockerfiles for health check support
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 16 cross-service integration tests exercising the full Order → Product → Notification flow, along with the minimum service implementations needed to support them.
Service implementations (previously scaffold stubs):
ProductEntity,IProductRepository/ProductRepository, fullProductControllerwithPOST /api/productandGET /api/product/{id},EnsureCreatedinProgram.cs.OrderEntity,IOrderRepository/OrderRepository,OrderController.Createthat:CustomerId != Guid.EmptyandQuantity > 0GET /api/product/{id}on Product service to validate product existence and fetch priceTotalAmount = product.Price * quantityOrderPlacedEventviaPOST /api/notification/events/order-placedto Notification serviceBug fix: All 5 service
.API.csprojfiles referenced Shared projects with..\..\Shared\...(resolves toServices/Shared/— doesn't exist). Fixed to..\..\..\Shared\....Test infrastructure:
docker-compose.integration.yml— postgres + rabbitmq + product/order/notification services with health checksDockerComposeFixture(xUnitICollectionFixture) — starts stack, polls/healthz, tears down withdocker compose down -vTestPriorityAttribute+PriorityOrdererfor deterministic test orderingIntegration tests (
OrderProductNotificationFlowTests):productName,unitPrice,totalAmountcomputed from productGET /api/notification→ verify notification has matchingorderId,customerId,orderTotal, rendered subjectGET /api/notification/{id}/preview) containsOrder ConfirmedproductId→ 400 +"does not exist"9–12. Error scenarios: empty
customerId, zero/negative quantity, emptyproductId→ 40013–15. GET non-existent order/product/notification → 404
Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/0b08b35ba5664b54807c3f392a3809c1
Requested by: @bsmitches