[TEST] Exclude name on ScriptContextInfo mutate (#50332) (#50337)

ScriptContextInfoSerializingTests:testEqualsAndHashcode was failing
because the mutation was generating the same name.

**Backport**

Fixes: #50331
This commit is contained in:
Stuart Tettemer 2019-12-18 14:23:21 -07:00 committed by GitHub
parent 4396a1f78b
commit 9cdbcbd121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ public class ScriptContextInfoSerializingTests extends AbstractSerializingTestCa
}
private static ScriptContextInfo mutate(ScriptContextInfo instance, Set<String> names) {
if (names == null) { names = new HashSet<>(); }
if (names == null) {
names = new HashSet<>();
names.add(instance.name);
}
switch (randomIntBetween(0, 2)) {
case 0:
return new ScriptContextInfo(