-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,14 @@ | |
|
||
import static org.junit.Assert.assertTrue; | ||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.io.File; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.stream.Collectors; | ||
import org.eclipse.lsp4j.jsonrpc.messages.Either; | ||
import org.junit.Test; | ||
|
@@ -105,10 +105,16 @@ public void runValidators() throws Exception { | |
assertTrue(result.isRight()); | ||
List<ValidationEvent> validationEvents = result.getRight().getValidationEvents(); | ||
assertFalse(validationEvents.isEmpty()); | ||
assertEquals( | ||
"Proto index 1 is used muliple times in members name,age of shape (structure: `some.test#MyStruct`).", | ||
validationEvents.get(0).getMessage() | ||
); | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. nit: I think you could a hamcrest matcher (or
or
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
if (!matchingEvent.isPresent()) { | ||
throw new AssertionError("Expected validation event with message `" + expectedMessage | ||
+ "`, but events were " + validationEvents); | ||
} | ||
} | ||
|
||
private static List<File> getFiles(String... filenames) throws Exception { | ||
|
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