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
refactor: Extract common code from responders into EntityAndClassIriS… #2348
Conversation
Codecov ReportBase: 86.68% // Head: 86.37% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #2348 +/- ##
==========================================
- Coverage 86.68% 86.37% -0.32%
==========================================
Files 250 268 +18
Lines 28252 28317 +65
==========================================
- Hits 24490 24458 -32
- Misses 3762 3859 +97
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
234ecd2
to
3c1d44d
Compare
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.
Overall looks good. There are few typos - see my comments/suggestions. Wouldn't also make sense to write some unit tests for stuff you have moved to separated services?
webapi/src/main/scala/org/knora/webapi/responders/ActorDeps.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/EntityAndClassIriService.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/EntityAndClassIriService.scala
Outdated
Show resolved
Hide resolved
In general I agree that new code should be covered with unit tests. I will look into if I can improve the coverage. However, I will have to look into if testing the |
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.
LGTM, just some suggestions regarding documentation / naming. In general, I agree with Marcin that we should have tests - if possible.
webapi/src/main/scala/org/knora/webapi/responders/EntityAndClassIriService.scala
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/EntityAndClassIriService.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/Responder.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/Responder.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/admin/GroupsResponderADM.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/admin/ListsResponderADM.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/admin/ProjectsAdminService.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/admin/ProjectsResponderADM.scala
Outdated
Show resolved
Hide resolved
webapi/src/main/scala/org/knora/webapi/responders/admin/ProjectsAdminService.scala
Outdated
Show resolved
Hide resolved
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.
Just found one minor thing while you were broadcasting.
webapi/src/main/scala/org/knora/webapi/responders/ActorToZioBridge.scala
Outdated
Show resolved
Hide resolved
5acf8c1
to
1a8daea
Compare
…idge and ActorDeps * Add zio-mock dependency to test dependencies * Extract EntityAndClassIriService * Introduce ActorDeps * Introduce ActorToZioBridge * Remove methods on abstract Responder and use iriService in Responder directly * Remove commented out code * Move handleUnexpectedMessage method into Responder and make protected * Expose ProjectsResponder as ProjectsService to ProjectRouteZ * Add scaladoc * Formatting
1a8daea
to
c3da43a
Compare
Pull Request Checklist
Task Description/Number
ProjectsAdminService
as at first a wrapper around its own instances of theProjectsResponderADM
exposing the method used in the zio http routeEntityAndClassIriService
as dedicated service allowing for breaking up the inheritance hierachyActorDeps
as a zio layer - a class encapsulating all Akka dependencies necessary to interact with the [[org.knora.webapi.core.actors.RoutingActor]] aka. "appActor"akka.pattern.ask
into the zio worldzio-mock
dependency to test dependenciesResponder
and useEntityAndClassIriService
handleUnexpectedMessage
method into Responder and make protectedProjectsService
toProjectRouteZ
Basic Requirements
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Does this PR change client-test-data?