-
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
Adding a context source layer #1308
Conversation
import java.net.URI | ||
|
||
@Service | ||
class EntityCompactionService( |
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 choose "compaction" name for the layer and for the class name, because i can't just take the logic from the context sources i also have to do the task associated with the compaction.
I am open to other name suggestion.
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.
Compaction, definitely not. Compaction is JSON-LD compaction, nothing else.
That being said, I think you have extracted too much and the responsibilities become unclear (and too wide).
Instead, I would say that the web handler:
- call a service that will match the CSR, call ContextSourceCaller to get the remote entities and return the result with the warning, the entities, ...
- call entityQueryService to get the local entities
- call ContextSourceUtils to merge the entities
// // DO NOT REVIEW WIP | ||
// // DO NOT REVIEW WIP | ||
// // DO NOT REVIEW WIP | ||
// // DO NOT REVIEW WIP | ||
// // DO NOT REVIEW WIP |
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.
Comming soon 😃 ...
} | ||
""".trimIndent() | ||
) | ||
} | ||
|
||
@Test | ||
fun `get entity by id should correctly filter the asked attributes`() = 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.
This test will be migrated in entityCompactionServiceTest.
@@ -480,342 +422,47 @@ class EntityHandlerTests { | |||
) | |||
} | |||
|
|||
@Test | |||
fun `get entity by id should return 404 if the entity has none of the requested attributes`() { |
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.
This test will be migrated in entityCompactionServiceTest.
.jsonPath("$.createdAt").doesNotExist() | ||
.jsonPath("$.modifiedAt").doesNotExist() | ||
} | ||
|
||
@Test | ||
fun `get entity by id should correctly serialize properties of type DateTime and display sysAttrs asked`() { |
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 am still looking if this test make sense in entityCompactionServiceTest.
} | ||
|
||
@Test | ||
fun `get entity by id should correctly serialize multi-attribute property having more than one instance`() { |
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 am still looking if this test make sense in entityCompactionServiceTest.
} | ||
|
||
@Test | ||
fun `get entity by id should correctly serialize multi-attribute relationship having one instance`() { |
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 am still looking if this test make sense in entityCompactionServiceTest.
} | ||
|
||
@Test | ||
fun `get entity by id should correctly serialize multi-attribute relationship having more than one instance`() { |
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 am still looking if this test make sense in entityCompactionServiceTest.
|
||
@Test | ||
fun `get entity by id should return the warnings sent by the CSRs and update the CSRs statuses`() { |
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.
This test will be migrated in entityCompactionServiceTest.
@@ -1258,42 +820,31 @@ class EntityHandlerTests { | |||
} | |||
|
|||
@Test | |||
fun `get entities should return the warnings sent by the CSRs and update the CSRs statuses`() { |
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.
This test will be migrated in entityCompactionServiceTest.
8b6d74b
to
e6fdb2c
Compare
Test Results1 files - 69 1 suites - 69 0s ⏱️ - 1m 24s Results for commit 92c2d73. ± Comparison against base commit e88ba43. This pull request removes 1291 tests.
♻️ This comment has been updated with latest results. |
No description provided.