[midPoint-git] [Evolveum/midpoint] a32a28: Remove method intended for testing only
Andrej
noreply at github.com
Mon Oct 6 09:17:12 CEST 2025
Branch: refs/heads/midpilot
Home: https://github.com/Evolveum/midpoint
Commit: a32a2853aff742172358b9b2c01be9daec7fc782
https://github.com/Evolveum/midpoint/commit/a32a2853aff742172358b9b2c01be9daec7fc782
Author: Andrej Zan <andrej.zan at evolveum.com>
Date: 2025-10-06 (Mon, 06 Oct 2025)
Changed paths:
M model/model-intest/pom.xml
M model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/smart/TestSmartIntegrationService.java
M model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/smart/TestSmartIntegrationServiceStory.java
A model/smart-api/src/main/java/com/evolveum/midpoint/smart/api/ServiceClientFactory.java
M model/smart-api/src/main/java/com/evolveum/midpoint/smart/api/SmartIntegrationService.java
A model/smart-impl/src/main/java/com/evolveum/midpoint/smart/impl/ConfigBasedServiceClientFactory.java
M model/smart-impl/src/main/java/com/evolveum/midpoint/smart/impl/SmartIntegrationServiceImpl.java
M model/smart-impl/src/test/java/com/evolveum/midpoint/smart/impl/AbstractSmartIntegrationTest.java
M model/smart-impl/src/test/java/com/evolveum/midpoint/smart/impl/TestCorrelatorSuggestions.java
A model/smart-impl/src/test/java/com/evolveum/midpoint/smart/impl/TestServiceClientFactory.java
M model/smart-impl/src/test/java/com/evolveum/midpoint/smart/impl/TestSmartIntegrationServiceImpl.java
Log Message:
-----------
Remove method intended for testing only
**What**
Remove method from `SmartIntegrationServiceImpl`, which was intended
just for use in test to override (mock) service client.
**Why**
The way how the service clients were initialized had several flaws:
- Requires extra dependency unrelated to the function of
the service itself (`SystemObjectCache`).
- Makes it hard to test the service, because the service client
inherently needs to be mocked (because the service the client calls is
an external entity). This was the reason for a "workaround" using the
mentioned method and class field.
- Because the extra method was not declared in the interface (rightfully
so), the test classes had to use the implementation instead of the
interface (in some cases relevant, but in the most not).
- Makes it impossible to use different implementations of service client
creation if necessary.
- Does not leverage the benefits of our Spring ecosystem (mainly the
application context), which can simply hold an instance of service
client factory, which may be injected where necessary.
This refactoring will also allow to potentially move the
`ServiceClientFactory` to other places where it is relevant (e.g. to
particular `*Operation` factories - not implemented yet) and thus
completely remove another dependency from the service.
Fix wrong reference to a method
**What**
Fix forgotten reference to a class/method which was moved to different
package.
To unsubscribe from these emails, change your notification settings at https://github.com/Evolveum/midpoint/settings/notifications
More information about the midPoint-svn
mailing list