-
Notifications
You must be signed in to change notification settings - Fork 20
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 CI for 1.44.0 bump #142
Conversation
A test depended on the ordering of validation events, which 1.44.0 changes.
String expectedMessage = "Proto index 1 is used muliple times in members name," + | ||
"age of shape (structure: `some.test#MyStruct`)."; | ||
Optional<ValidationEvent> matchingEvent = validationEvents.stream() | ||
.filter(ev ->ev.getMessage().equals(expectedMessage)).findFirst(); |
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.
nit: I think you could a hamcrest matcher (or orElseThrow
) to make this a little cleaner
assertThat(validationEvents, hasItem(hasProperty("message", equals(expectedMessage)))
or
.orElseThrow(() -> new AssertionError(...))
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 would if we used hamcrest in the language server. Will be adding it in the future though.
validationEvents.get(0).getMessage() | ||
); | ||
|
||
String expectedMessage = "Proto index 1 is used muliple times in members name," + |
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.
Nit, there is a typo on "muliple" and a missing white space after the comma.
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.
Yea, that's just the message the validator produces, which lives in a jar in test resources. I don't remember where exactly it came from
A test depended on the ordering of validation events, which 1.44.0 changes.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.