Testplan array contains should discard order

- Replace contains with containsInAnyOrder for asserts.
- Fixes #883
This commit is contained in:
Janne Valkealahti
2020-10-18 17:03:30 +01:00
parent 991a5df163
commit b46a147091

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 the original author or authors.
* Copyright 2015-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
*/
package org.springframework.statemachine.test;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
@@ -238,7 +237,7 @@ public class StateMachineTestPlan<S, E> {
for (State<S, E> s : listener.getStateEntered()) {
states.add(s.getId());
}
assertThat(step.expectStatesEntrered, contains(states.toArray()));
assertThat(step.expectStatesEntrered, containsInAnyOrder(states.toArray()));
}
}
@@ -248,7 +247,7 @@ public class StateMachineTestPlan<S, E> {
for (State<S, E> s : listener.getStateExited()) {
states.add(s.getId());
}
assertThat(step.expectStatesExited, contains(states.toArray()));
assertThat(step.expectStatesExited, containsInAnyOrder(states.toArray()));
}
}