Fixed the flakiness in the test com.j256.ormlite.field.FieldTypeTest.testAssignForeign. It was flaky because the order of fields the method getDeclaredFields() returns is nondeterministic. I sort the Fields[] after I get them, so the name field will always be the third one in the Field[], then I get the name field by using Field field = fields[2];.
Fixed the flakiness in the test
com.j256.ormlite.field.FieldTypeTest.testAssignForeign
. It was flaky because the order of fields the methodgetDeclaredFields()
returns is nondeterministic. I sort the Fields[] after I get them, so the name field will always be the third one in the Field[], then I get the name field by usingField field = fields[2];
.