Increases iterations on step equality tests

To make it in line with the fact that other equality tests use multiple iterations
This commit is contained in:
Colin Goodheart-Smithe 2018-04-12 12:23:35 +01:00
parent e8cb6419f8
commit 1c2e7bc431
1 changed files with 5 additions and 1 deletions

View File

@ -10,11 +10,15 @@ import org.elasticsearch.test.EqualsHashCodeTestUtils;
public abstract class AbstractStepTestCase<T extends Step> extends ESTestCase {
protected static final int NUMBER_OF_TEST_RUNS = 20;
protected abstract T createRandomInstance();
protected abstract T mutateInstance(T instance);
protected abstract T copyInstance(T instance);
public void testHashcodeAndEquals() {
EqualsHashCodeTestUtils.checkEqualsAndHashCode(createRandomInstance(), this::copyInstance, this::mutateInstance);
for (int runs = 0; runs < NUMBER_OF_TEST_RUNS; runs++) {
EqualsHashCodeTestUtils.checkEqualsAndHashCode(createRandomInstance(), this::copyInstance, this::mutateInstance);
}
}
}