-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refacto csr logic to context source caller #1311
base: develop
Are you sure you want to change the base?
Conversation
search-service/src/test/kotlin/com/egm/stellio/search/entity/web/EntityHandlerTests.kt
Show resolved
Hide resolved
search-service/src/test/kotlin/com/egm/stellio/search/entity/web/EntityHandlerTests.kt
Show resolved
Hide resolved
7428f65
to
975dcc6
Compare
Test Results 70 files ±0 70 suites ±0 1m 24s ⏱️ -2s Results for commit 3ba9204. ± Comparison against base commit a6b8b37. This pull request removes 193 and adds 41 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Quality Gate passedIssues Measures |
please write "refactor", it's only one more letter and it is a real word |
@@ -30,10 +36,48 @@ import java.net.URI | |||
|
|||
typealias QueryEntitiesResponse = Pair<List<CompactedEntity>, Int?> | |||
|
|||
object ContextSourceCaller { | |||
@Service | |||
class ContextSourceCaller( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep the convention of suffixing by Service
everything that is a service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be better named something like DistributedOperationService
. Or maybe even better DistributedConsumptionOperationService
(since having all the dist ops in just one service will not be possible). Even this will end up in 3 services (provision, consumption and subscription) that will quickly be too big. So my final word is DistributedEntityConsumptionOperationService
(or DistributedEntityConsumptionService
).
val logger: Logger = LoggerFactory.getLogger(javaClass) | ||
|
||
suspend fun retrieveContextSourceEntity( | ||
suspend fun retrieveEntityFromAllContextSources( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
distributeRetrieveEntityOperation
?
@@ -55,7 +99,45 @@ object ContextSourceCaller { | |||
) | |||
} | |||
|
|||
suspend fun queryContextSourceEntities( | |||
suspend fun queryEntitiesFromAllContextSources( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
distributeQueryEntitiesOperation
?
@@ -100,7 +123,7 @@ class ContextSourceCallerTests { | |||
} | |||
|
|||
@Test | |||
fun `queryContextSourceEntities should return a RevalidationFailedWarning when receiving bad payload`() = runTest { | |||
fun `queryEntities ContextSource should return a RevalidationFailedWarning when receiving bad payload`() = runTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fun `queryEntities ContextSource should return a RevalidationFailedWarning when receiving bad payload`() = runTest { | |
fun `queryEntitiesFromContextSource should return a RevalidationFailedWarning when receiving bad payload`() = runTest { |
@@ -4,13 +4,8 @@ import arrow.core.getOrElse | |||
import arrow.core.left |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not forget to update Detekt baseline
No description provided.