{"record":{"id":"14931536b7b409d7","repo":"quarkusio/quarkus","slug":"not-equal-expected-expected-actual","errorCode":null,"errorMessage":"Not equal; expected: \" + expected + \", actual: \" + actual","messagePattern":"Not equal; expected: \" \\+ expected \\+ \", actual: \" \\+ 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":91,"sourceCode":"                checkEqual(createdEntity.uuid, loadedEntity.uuid);\n                checkEqual(createdEntity.instant, loadedEntity.instant);\n                checkEqual(createdEntity.offsetTime.toLocalTime().atOffset(ZoneId.systemDefault().getRules().getOffset(Instant.now())),\n                        loadedEntity.offsetTime);\n                checkEqual(createdEntity.offsetDateTime.atZoneSameInstant(ZoneId.systemDefault()).toOffsetDateTime(),\n                        loadedEntity.offsetDateTime);\n                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":73,"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#L73-L103","documentation":"An AssertionError thrown by the checkEqual helper in the Hibernate ORM 5.6 compatibility integration test when an expected value (read from a database generated by Hibernate ORM 5.6) does not equal the actual value (read via Quarkus' newer Hibernate ORM). It signals a data or schema-mapping incompatibility between the ORM versions for the compared column/table.","triggerScenarios":"checkEqual(expected, actual) is invoked by the run() workflow comparing int arrays or objects read from the 5.6-generated database against values read/written by the current ORM; Objects.equals or Arrays.equals returns false and the AssertionError is thrown.","commonSituations":"Hibernate ORM 6+ changed default column types, naming, or value mapping versus 5.6 so data round-trips differently; the 5.6 generator produced data with types the new ORM reads differently (e.g. temporal/serializable types); the generator was not re-run after schema changes.","solutions":["Compare the failing expected vs actual values in the AssertionError message to identify the mismatched column/entity","Regenerate the 5.6 database with the database-generator after any schema or entity changes","Check for ORM 5.6-to-6 migration mapping differences (types, naming strategy, ID generation) affecting the compared data","Update the expected values or add an explicit mapping/compatibility workaround if the difference is an intentional ORM change"],"exampleFix":"// before\nprivate <T> void checkEqual(T expected, T actual) {\n    if (!Objects.equals(expected, actual)) throw new AssertionError(...);\n}\n// after\nprivate <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// and regenerate the 5.6 database so expected matches the current schema","handlingStrategy":"validation","validationCode":"if (!Arrays.equals(expected, actual)) {\n    throw new AssertionError(\"Version mismatch: expected=\" + Arrays.toString(expected) + \" actual=\" + Arrays.toString(actual));\n}\n// run before comparing: regenerate 5.6 database and confirm schema matches current mappings","typeGuard":null,"tryCatchPattern":"try {\n    run();\n} catch (AssertionError e) {\n    if (e.getMessage().startsWith(\"Not equal;\")) {\n        // regenerate the 5.6 database, then re-run comparison\n    }\n}","preventionTips":["Regenerate the 5.6-generated database after every entity/schema change","Review ORM 5.6 -> 6 migration notes for changed type mappings","Make checkEqual messages include both full values for fast diffing"],"tags":["hibernate-orm","compatibility","migration","assertion"],"backgroundTag":"orm-version-migration-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"}