Skip to content

Commit

Permalink
fix(core): flaky labels tests
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jul 18, 2023
1 parent 2321500 commit 0679b84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Optional;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.is;

@MicronautTest
Expand Down Expand Up @@ -59,7 +60,7 @@ void success() {

assertThat(evaluate.isPresent(), is(true));
assertThat(evaluate.get().getFlowId(), is("flow-with-flow-trigger"));
assertThat(evaluate.get().getLabels().get(0), is(new Label("flow-label-1", "flow-label-1")));
assertThat(evaluate.get().getLabels().get(1), is(new Label("flow-label-2", "flow-label-2")));
assertThat(evaluate.get().getLabels(), hasItem(new Label("flow-label-1", "flow-label-1")));
assertThat(evaluate.get().getLabels(), hasItem(new Label("flow-label-2", "flow-label-2")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import jakarta.inject.Inject;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.is;

@MicronautTest
Expand Down Expand Up @@ -92,8 +93,8 @@ void success() throws Exception {
assertThat(dateFromVars(vars.get("date"), date), is(date));
assertThat(dateFromVars(vars.get("next"), date), is(date.plusMonths(1)));
assertThat(dateFromVars(vars.get("previous"), date), is(date.minusMonths(1)));
assertThat(evaluate.get().getLabels().get(0), is(new Label("flow-label-1", "flow-label-1")));
assertThat(evaluate.get().getLabels().get(1), is(new Label("flow-label-2", "flow-label-2")));
assertThat(evaluate.get().getLabels(), hasItem(new Label("flow-label-1", "flow-label-1")));
assertThat(evaluate.get().getLabels(), hasItem(new Label("flow-label-2", "flow-label-2")));
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.concurrent.atomic.AtomicReference;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.*;

Expand Down Expand Up @@ -94,8 +95,8 @@ void thread() throws Exception {

assertThat(last.get().getTrigger().getVariables().get("defaultInjected"), is("done"));
assertThat(last.get().getTrigger().getVariables().get("counter"), is(3));
assertThat(last.get().getLabels().get(0), is(new Label("flow-label-1", "flow-label-1")));
assertThat(last.get().getLabels().get(1), is(new Label("flow-label-2", "flow-label-2")));
assertThat(last.get().getLabels(), hasItem(new Label("flow-label-1", "flow-label-1")));
assertThat(last.get().getLabels(), hasItem(new Label("flow-label-2", "flow-label-2")));
AbstractSchedulerTest.COUNTER = 0;
}
}
Expand Down

0 comments on commit 0679b84

Please sign in to comment.