Skip to content

Commit

Permalink
JBEHAVE-744: Unit test CompositeStepCandidateBehaviour.shouldMatchCom…
Browse files Browse the repository at this point in the history
…positeStepsAndCreateComposedNestedSteps can fail due to random list ordering

added lookup for base step
  • Loading branch information
alexlehm committed Mar 15, 2012
1 parent 6c2c510 commit d562fa9
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertNotNull;

public class CompositeStepCandidateBehaviour {

Expand Down Expand Up @@ -151,7 +152,15 @@ public void aProductIsAddedToCart(String product) {
public void shouldMatchCompositeStepsAndCreateComposedNestedSteps() {
CompositeNestedSteps steps = new CompositeNestedSteps();
List<StepCandidate> candidates = steps.listCandidates();
StepCandidate candidate = candidates.get(0);
// find main step
StepCandidate candidate = null;
for(StepCandidate cand: candidates) {
if(cand.getPatternAsString().equals("all buttons are enabled")) {
candidate = cand;
break;
}
}
assertNotNull(candidate);
assertThat(candidate.isComposite(), is(true));
Map<String, String> noNamedParameters = new HashMap<String, String>();
List<Step> composedSteps = new ArrayList<Step>();
Expand Down

0 comments on commit d562fa9

Please sign in to comment.