-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple HTTP status codes for HttpWaitStrategy (#630)
* Support multiple HTTP status codes for HttpWaitStrategy In the context of elasticsearch test containers module, I'd like to add an ElasticsearchWaitStrategy class which extends the HttpWaitStrategy with some default settings so it will be even easier for a end user to start an ElasticsearchTestContainer. Anyway, in this context, I found helpful that the HttpWaitStrategy expects more than on status code. For example, you can imagine running elasticsearch in secure mode or without any security. In which cases the elasticsearch service might answer 200 or 401. This commit proposes this change. * Revert changes in Deprecated class * Revert changes in Deprecated class * Make forStatusCode chainable and add forStatusCodeMatching method `forStatusCodeMatching()` comes with a default Predicate which checks status codes that have been provided with `forStatusCode()`. Also copied the default tests which were using the deprecated package to the new one to make sure we test the new methods. * Fix quality * Fix compile issue * Support both Predicates and Status codes Also use a Set instead of a List to avoid duplicates. * Fix setter * Revert unrelated change * Fix error message (note that with predicates it might be incorrect though) * Fix default predicate * Move WaitStrategy tests to the right package And stop testing deprecated methods * Add a test (and fix the bug!) * Add more tests * Add entry in changelog
- Loading branch information
Showing
11 changed files
with
227 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
core/src/test/java/org/testcontainers/junit/wait/HostPortWaitStrategyTest.java
This file was deleted.
Oops, something went wrong.
72 changes: 0 additions & 72 deletions
72
core/src/test/java/org/testcontainers/junit/wait/HttpWaitStrategyTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.