refactor(di): remove mock DI container, use common_system service_container#485
Merged
kcenon merged 1 commit intoFeb 23, 2026
Merged
Conversation
…ntainer Remove ~200-line mock service_container_interface implementation from test_di_container.cpp and rewrite all tests to use the real common_system::di::service_container. Changes: - Remove stub service_container_interface, service_locator, create_lightweight_container, create_thread_system_adapter - Rewrite 14 tests using service_container API directly - Add tests for: resolve_or_null, unregister, duplicate detection, registered_services descriptors, freeze behavior - Remove mock-specific tests (named services, service locator, thread system adapter factory) All 26 DI-related tests pass (14 container + 12 service registration). Part of kcenon/common_system#368
3 tasks
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
…ntainer (#485) Remove ~200-line mock service_container_interface implementation from test_di_container.cpp and rewrite all tests to use the real common_system::di::service_container. Changes: - Remove stub service_container_interface, service_locator, create_lightweight_container, create_thread_system_adapter - Rewrite 14 tests using service_container API directly - Add tests for: resolve_or_null, unregister, duplicate detection, registered_services descriptors, freeze behavior - Remove mock-specific tests (named services, service locator, thread system adapter factory) All 26 DI-related tests pass (14 container + 12 service registration). Part of kcenon/common_system#368
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
service_container_interfacefromtest_di_container.cppcommon_system::di::service_containerdirectlyservice_registration.halready correctly integrates withservice_containerCloses kcenon/common_system#368
Context
This is Phase 4 of the DI container consolidation effort (kcenon/common_system#363).
The monitoring_system already properly uses
common_system::service_containerviaservice_registration.h. The only cleanup needed was removing a mock DI implementationfrom the test file that duplicated service_container functionality.
Verification Summary
service_registration.hfollows ecosystem conventionsIServiceContainer&properlyTest Plan
DIContainerTestsuite: 14 tests using real service_containerMonitorServiceRegistrationTestsuite: 12 tests (unchanged, already correct)