test: drop PropertiesService mock and fix test property in queue IT #20

Merged
robinp2000 merged 1 commit from robinp2000/test/queue-integration-test-config into main 2026-10-14 22:08:54 +02:00 AGit
Owner

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.
## 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.
test: drop PropertiesService mock and fix test property in queue IT
All checks were successful
CI / build (pull_request) Successful in 2m17s
77af574c27
## 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
robinp2000/dachshund-auth-provider!20
No description provided.