Skip to content

Commit

Permalink
Re #123: Making tests more robust to random ordering o replies from L…
Browse files Browse the repository at this point in the history
…oki.
  • Loading branch information
tkowalcz committed Jul 19, 2024
1 parent 9cafe15 commit c0f5722
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pl.tkowalcz.tjahzi.log4j2.infra.IntegrationTest;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.core.Every.everyItem;
import static pl.tkowalcz.tjahzi.log4j2.infra.LokiAssert.assertThat;
Expand Down Expand Up @@ -38,9 +38,9 @@ void shouldSendData() {
.returns(response -> response
.body("data.result.size()", equalTo(3))
.body("data.result.stream.server", everyItem(equalTo("127.0.0.1")))
.body("data.result.stream.object", contains("prefix_", "prefix_bus_ticket", "prefix_comb"))
.body("data.result.stream.owner", contains("_suffix", "wally_suffix", "jennifer_suffix"))
.body("data.result.stream.default_value_test", contains("use_this_if_missing", "use_this_if_missing", "use_this_if_missing"))
.body("data.result.stream.object", containsInAnyOrder("prefix_", "prefix_bus_ticket", "prefix_comb"))
.body("data.result.stream.owner", containsInAnyOrder("_suffix", "wally_suffix", "jennifer_suffix"))
.body("data.result.stream.default_value_test", containsInAnyOrder("use_this_if_missing", "use_this_if_missing", "use_this_if_missing"))
.body("data.result.values",
hasItems(
hasItems(hasItems("LabelsContextSubstitutionTest - Test3")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void shouldSendData() {
.body("data.result.stream.server", everyItem(equalTo("127.0.0.1")))
.body("data.result.stream.class_pattern", everyItem(equalTo("p.t.t.l.l.Log4jPatternsInLabelsTest")))
.body("data.result.stream.sequence_number", contains("2", "1"))
.body("data.result.stream.mdc_tid", contains("", "req-230rq9ubou"))
.body("data.result.stream.mdc_tid", contains(null, "req-230rq9ubou"))
.body("data.result.values",
hasItems(
hasItems(hasItems("Log4jPatternsInLabelsTest - Test2")),
Expand Down

0 comments on commit c0f5722

Please sign in to comment.