[LANG-1514] make test more stable by using HashSet to compare
This commit is contained in:
parent
a606a0328b
commit
4b11c764e5
|
@ -36,6 +36,7 @@ import java.lang.reflect.Field;
|
|||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
|
@ -188,7 +189,7 @@ public class FieldUtilsTest {
|
|||
final List<Field> fieldsInteger = Arrays.asList(Integer.class.getDeclaredFields());
|
||||
final List<Field> allFieldsInteger = new ArrayList<>(fieldsInteger);
|
||||
allFieldsInteger.addAll(fieldsNumber);
|
||||
assertEquals(allFieldsInteger, FieldUtils.getAllFieldsList(Integer.class));
|
||||
assertEquals(new HashSet(allFieldsInteger), new HashSet(FieldUtils.getAllFieldsList(Integer.class)));
|
||||
final List<Field> allFields = FieldUtils.getAllFieldsList(PublicChild.class);
|
||||
// Under Jacoco,0.8.1 and Java 10, the field count is 7.
|
||||
int expected = 5;
|
||||
|
|
Loading…
Reference in New Issue