-
Notifications
You must be signed in to change notification settings - Fork 122
Add integration tests, Docker on CI, and implement waitForPendingUpdate #32
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
Conversation
2642014
to
412140e
Compare
e7a7579
to
f4e3b6f
Compare
f4e3b6f
to
2278605
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.
Two useless suggestions 😇
Great work, I approve!
Co-authored-by: Clémentine Urquizar <[email protected]>
Co-authored-by: Clémentine Urquizar <[email protected]>
* @param intervalInMs number of milliseconds before requesting the status again | ||
* @throws Exception if timeout is reached | ||
*/ | ||
public void waitForPendingUpdate(int updateId, int timeoutInMs, int intervalInMs) 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.
maybe something like a CompletableFuture<UpdateStatus>
would be better for something like this.
Supply the updateId -> thenApply(...) the while loop -> call .get(timeout)
public String moviesFileToString () { | ||
String content = ""; | ||
String filePath = "src/test/java/com/meilisearch/sdk/movies.json"; | ||
try | ||
{ | ||
content = new String ( Files.readAllBytes( Paths.get(filePath) ) ); | ||
} | ||
catch (IOException e) | ||
{ | ||
e.printStackTrace(); | ||
} | ||
this.movies_data = content; | ||
return content; | ||
} |
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.
please put the json file unter src/test/resources/movies.json
src/test/java should only contain java files
Also, please load the File from classpath.
This way we can move around our source files without to worry about where the json is located ;)
String movies_data; | ||
Movie[] movies = new Movie[10]; | ||
Gson gson = new Gson(); |
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.
more of a general point: unless you really need fields package private, just declare them as private.
helps to avoid other parts of the program fucking around with the internal state of the class.
@niemannd thanks for your review! |
The goal for this PR is:
waitForPendingUpdate()
method (Add WaitForPendingUpdate method #23)(it will be mandatory to pass integration tests for merging a PR into master after this PR is merged)
Related to this issue: @niemannd propose some unit testing in #31
Closes #14
Closes #23