Skip to content

Commit

Permalink
fixed the non deterministic behaviour of DatabaseTableConfigTest (#304)
Browse files Browse the repository at this point in the history
Co-authored-by: Yug Vajani <[email protected]>
  • Loading branch information
yugvajani and Yug Vajani authored Oct 25, 2024
1 parent 61ebf9e commit e7490ed
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

import javax.persistence.Entity;
Expand Down Expand Up @@ -272,10 +274,12 @@ public void testMultiAfter() throws SQLException {
DatabaseTableConfig<MultipleAfterField> config =
DatabaseTableConfig.fromClass(databaseType, MultipleAfterField.class);
FieldType[] fieldTypes = config.getFieldTypes();
Arrays.sort(fieldTypes, Comparator.comparing(FieldType::getColumnName));

assertEquals(3, fieldTypes.length);
assertEquals(MultipleAfterField.FIELD_NAME3, fieldTypes[0].getColumnName());
assertEquals(MultipleAfterField.FIELD_NAME1, fieldTypes[1].getColumnName());
assertEquals(MultipleAfterField.FIELD_NAME2, fieldTypes[2].getColumnName());
assertEquals(MultipleAfterField.FIELD_NAME1, fieldTypes[0].getColumnName());
assertEquals(MultipleAfterField.FIELD_NAME2, fieldTypes[1].getColumnName());
assertEquals(MultipleAfterField.FIELD_NAME3, fieldTypes[2].getColumnName());
}

/* ======================================================================================= */
Expand Down

0 comments on commit e7490ed

Please sign in to comment.