Skip to content

Commit

Permalink
Use matchers to in flaky DevMojoIT in order to get proper logs when t…
Browse files Browse the repository at this point in the history
…he test fails

Relates to: quarkusio#16524
  • Loading branch information
geoand committed Jul 6, 2021
1 parent 91d461f commit 51c50ee
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static io.quarkus.maven.it.ApplicationNameAndVersionTestUtil.assertApplicationPropertiesSetCorrectly;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
Expand Down Expand Up @@ -838,15 +840,15 @@ public void testThatNewResourcesAreServed() throws MavenInvocationException, IOE
await()
.pollDelay(100, TimeUnit.MILLISECONDS)
.atMost(1, TimeUnit.MINUTES)
.until(() -> DevModeTestUtils.getHttpResponse("/lorem.txt").contains("Lorem ipsum"));
.until(() -> DevModeTestUtils.getHttpResponse("/lorem.txt"), containsString("Lorem ipsum"));

// Update the resource
String uuid = UUID.randomUUID().toString();
FileUtils.write(source, uuid, "UTF-8");
await()
.pollDelay(100, TimeUnit.MILLISECONDS)
.atMost(1, TimeUnit.MINUTES)
.until(() -> DevModeTestUtils.getHttpResponse("/lorem.txt").contains(uuid));
.until(() -> DevModeTestUtils.getHttpResponse("/lorem.txt"), equalTo(uuid));

// Delete the resource
source.delete();
Expand Down

0 comments on commit 51c50ee

Please sign in to comment.