test: drop PropertiesService mock and fix test property in queue IT #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "robinp2000/test/queue-integration-test-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Why
Tests
Notes
## What - ChangeQueueIntegrationTest uses the real PropertiesService instead of a Mockito bean. The tests set QUEUE_DELAY via setProperty (PT0S in setUp, PT1H in the scheduling test) and restore the default in an @AfterEach. - The Altcha test key moves from @TestPropertySource on the nested TestConfig to @SpringBootTest(properties = ...). - New check testProperty_shouldReachTheApplicationContext asserts that the key set for the tests is the one the context resolves. - Javadoc and comments no longer mention H2 or a mocked properties table. ## Why - The mock dated from the H2 time ("needs a seeded properties table"). Flyway now creates the table on PostgreSQL and PropertiesService seeds the defaults of every property type on ApplicationReadyEvent, so nothing needs mocking. - @TestPropertySource is read from the test class (and its superclasses), not from a nested @TestConfiguration, so the key never applied. Test and filter resolve the key from the same environment, so every test passed with whatever key the context had and nothing showed it. The new check was red first (expected the test key, got a generated one) and is green with this change. ## Tests - ./mvnw -B test: 584 tests, all green. ## Notes - Test-only change, no production code touched. - The properties table is real state in the test database; the queue delay is reset to its default after each test.