j256 / ormlite-core

Core ORMLite functionality that provides a lite Java ORM in conjunction with ormlite-jdbc or ormlite-android
http://ormlite.com/
ISC License
578 stars 213 forks source link

fix flaky test testAssignForeign in FieldTypeTest #227

Closed NanaOkada closed 3 years ago

NanaOkada commented 3 years ago

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];.

j256 commented 3 years ago

Dup of #228