[TEST] Fix JiraIssueTests.testEquals()
This commit fixes a test bug were a random field is picked out of an empty collection. Original commit: elastic/x-pack-elasticsearch@a42dff7257
This commit is contained in:
parent
158ab2e724
commit
4978d3a8e0
|
@ -99,8 +99,11 @@ public class JiraIssueTests extends ESTestCase {
|
||||||
|
|
||||||
final Map<String, Object> fields = new HashMap<>(issue1.getFields());
|
final Map<String, Object> fields = new HashMap<>(issue1.getFields());
|
||||||
if (equals == false) {
|
if (equals == false) {
|
||||||
String key = randomFrom(fields.keySet());
|
if (fields.isEmpty()) {
|
||||||
fields.remove(key);
|
fields.put(randomAsciiOfLength(5), randomAsciiOfLength(10));
|
||||||
|
} else {
|
||||||
|
fields.remove(randomFrom(fields.keySet()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JiraIssue issue2 = new JiraIssue(fields, issue1.getRequest(), issue1.getResponse(), issue1.getFailureReason());
|
JiraIssue issue2 = new JiraIssue(fields, issue1.getRequest(), issue1.getResponse(), issue1.getFailureReason());
|
||||||
|
|
Loading…
Reference in New Issue