test(document): add query-count assertions for findAll + findById entity graphs

Adds Hibernate statistics to the test config and two new tests in
DocumentRepositoryTest:
- findAll_withSpecAndPageable asserts ≤5 statements for 10 documents
  (currently RED: EAGER @ManyToMany generates 31 secondary SELECTs)
- findById regression guard verifies collections load in ≤2 statements

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-18 16:43:36 +02:00
committed by marcel
parent 164a917d95
commit 9b9bfde843
2 changed files with 74 additions and 0 deletions

View File

@@ -13,6 +13,10 @@ spring:
password: test
mail:
host: localhost
jpa:
properties:
hibernate:
generate_statistics: true
# Disable OTel SDK entirely in tests — prevents auto-configuration from loading resource providers
# (e.g. AzureAppServiceResourceProvider) that fail against the semconv version used here.