-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix(api-v2): Change link value comment #1582
Conversation
@benjamingeer I suggest that @lrosenth first try this PR. I am happy to have a look at the implementation details in knora-api after his approval. |
@tobiasschweizer It looks like @lrosenth doesn't have time to review this. Should I ask someone else? |
I can do it, is Thursday ok? |
OK thanks! |
@@ -2701,6 +2701,44 @@ class ValuesRouteV2E2ESpec extends E2ESpec { | |||
savedTargetIri should ===(linkTargetIri) | |||
} | |||
|
|||
"update a link between two resources, changing only the comment" in { |
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.
The link value that gets updated here was created in
without a comment. Then a comment gets added in "update a link between two resources, changing only the comment". Shouldn't we ideally have test cases for
- create a value with an initial comment that then gets changed
- create a value without a comment that is added
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.
Good idea, I'll do that.
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.
Ideally, you could also do that for webapi/src/test/scala/org/knora/webapi/responders/v2/ValuesResponderV2Spec.scala
.
Maybe it would not hurt to do it for a non link value too. I guess these have a common template so testing one non linking value would be ok to begin with, right?
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.
Yes, it's only link values that are handled by separate templates.
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.
Great!
Is this understanding correct?
To create a new version of a value either the value itself has to be different (regardless of its comment being different from the previous version) or just its comment (this includes submitting a comment for a value that did not have any comment before).
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.
That should remove the comment from the value.
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.
That should remove the comment from the value.
Is there already a test for this? ;-)
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.
Will add a test for that.
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.
great!
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 added a lot of tests, see if this looks OK to you.
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.
That looks paranoid enough to me ;-)
That's high praise. :) |
This PR fixes the case where the client changes only the comment on a
LinkValue
.Fixes #1574.