-
Notifications
You must be signed in to change notification settings - Fork 54k
BAEL-9123: Added unit tests for elasticsearch wildcard service #18879
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Diego Torres <[email protected]>
persistence-modules/spring-data-elasticsearch-2/src/main/resources/log4j2.properties
Outdated
Show resolved
Hide resolved
...2/src/test/java/com/baeldung/wildcardsearch/ElasticsearchWildcardServiceIntegrationTest.java
Outdated
Show resolved
Hide resolved
...2/src/test/java/com/baeldung/wildcardsearch/ElasticsearchWildcardServiceIntegrationTest.java
Outdated
Show resolved
Hide resolved
...2/src/test/java/com/baeldung/wildcardsearch/ElasticsearchWildcardServiceIntegrationTest.java
Outdated
Show resolved
Hide resolved
| <version>${spring-boot.version}</version> | ||
| </dependency> | ||
|
|
||
| <!-- https://mvnrepository.com/artifact/org.testcontainers/elasticsearch --> |
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.
| <!-- https://mvnrepository.com/artifact/org.testcontainers/elasticsearch --> |
...-elasticsearch-2/src/main/java/com/baeldung/wildcardsearch/ElasticsearchWildcardService.java
Outdated
Show resolved
Hide resolved
| // Wait for documents to be indexed | ||
| try { | ||
| Thread.sleep(1500); | ||
| } catch (InterruptedException e) { | ||
| Thread.currentThread().interrupt(); | ||
| } |
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.
We can't use Thread.sleep - there should be a better way to specifically wait until the documents are indexed - as written this will either be a flaky test or waste CI build time
...search-2/src/test/java/com/baeldung/wildcardsearch/ElasticsearchWildcardServiceUnitTest.java
Show resolved
Hide resolved
Signed-off-by: Diego Torres <[email protected]>
Signed-off-by: Diego Torres <[email protected]>
...2/src/test/java/com/baeldung/wildcardsearch/ElasticsearchWildcardServiceIntegrationTest.java
Outdated
Show resolved
Hide resolved
| String email = emailObj != null ? emailObj.toString() | ||
| .toLowerCase() : ""; | ||
|
|
||
| assertTrue(name.contains("john") || email.contains("john"), "Expected 'john' in name or email"); |
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.
Missed this one (not using AssertJ like the other refactors)
No description provided.