{"record":{"id":"c79f043a6c12141a","repo":"quarkusio/quarkus","slug":"not-equal-expected-arrays-tostring-expected","errorCode":null,"errorMessage":"Not equal; expected: \" + Arrays.toString(expected) + \", actual: \" + Arrays.toString(actual)","messagePattern":"Not equal; expected: \" \\+ Arrays\\.toString\\(expected\\) \\+ \", actual: \" \\+ Arrays\\.toString\\(actual\\)","errorType":"console","errorClass":"AssertionError","httpStatus":null,"severity":"error","filePath":"integration-tests/hibernate-orm-compatibility-5.6/database-generator/src/main/java/io/quarkus/it/hibernate/compatibility/Main.java","lineNumber":97,"sourceCode":"                checkEqual(createdEntity.zonedDateTime.withZoneSameInstant(ZoneId.systemDefault()), loadedEntity.zonedDateTime);\n                checkEqual(createdEntity.intArray, loadedEntity.intArray);\n                checkEqual(createdEntity.stringList, loadedEntity.stringList);\n                checkEqual(createdEntity.myEnum, loadedEntity.myEnum);\n            });\n\n            System.out.println(\"Done.\");\n            return 0;\n        }\n\n        private <T> void checkEqual(T expected, T actual) {\n            if (!Objects.equals(expected, actual)) {\n                throw new AssertionError(\"Not equal; expected: \" + expected + \", actual: \" + actual);\n            }\n        }\n\n        private void checkEqual(int[] expected, int[] actual) {\n            if (!Arrays.equals(expected, actual)) {\n                throw new AssertionError(\"Not equal; expected: \" + Arrays.toString(expected)\n                        + \", actual: \" + Arrays.toString(actual));\n            }\n        }\n    }\n}\n","sourceCodeStart":79,"sourceCodeEnd":103,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/hibernate-orm-compatibility-5.6/database-generator/src/main/java/io/quarkus/it/hibernate/compatibility/Main.java#L79-L103","documentation":"This AssertionError is thrown by the Hibernate 5.6 compatibility integration test when two int[] arrays (expected vs actual query results) differ in content or order. It is a test-side assertion, not a library error, meaning the migration behavior produced different data than the baseline.","triggerScenarios":"Running Main.run() against the compatibility database when entity rows migrated from Hibernate ORM 5.6 do not match the expected id ordering/data returned by the same query under the newer ORM version.","commonSituations":"Schema or dialect differences between Hibernate 5.6 and the newer version, missing data migration, differing default ordering of results, or test data seeded incorrectly.","solutions":["Inspect the expected vs actual array contents in the message to identify which rows differ","Verify the database schema matches what the generator produced for 5.6","Check for ORM version-specific query ordering; add explicit ORDER BY if order matters","Re-seed test data and re-run the test"],"exampleFix":"// before\nthrow new AssertionError(\"Not equal; expected: \" + expected + \", actual: \" + actual);\n// after\nthrow new AssertionError(\"Not equal; expected: \" + Arrays.toString(expected) + \", actual: \" + Arrays.toString(actual));","handlingStrategy":"validation","validationCode":"if (!Arrays.equals(expected, actual)) { System.err.println(\"expected=\" + Arrays.toString(expected) + \" actual=\" + Arrays.toString(actual)); }","typeGuard":null,"tryCatchPattern":"try { run(); } catch (AssertionError e) { log.error(\"Data mismatch after migration: {}\", e.getMessage()); throw e; }","preventionTips":["Add ORDER BY to queries whose order you assert on","Seed deterministic test data before comparing","Compare as sets when order is not significant"],"tags":["test-assertion","hibernate","migration","integration-test"],"backgroundTag":"test-assertion-mismatch","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}