test: update tests for localization changes
diff --git a/src/test/java/org/eclipse/yasson/defaultmapping/specific/DeserializationExceptionTest.java b/src/test/java/org/eclipse/yasson/defaultmapping/specific/DeserializationExceptionTest.java index 155f611..f6cff1f 100644 --- a/src/test/java/org/eclipse/yasson/defaultmapping/specific/DeserializationExceptionTest.java +++ b/src/test/java/org/eclipse/yasson/defaultmapping/specific/DeserializationExceptionTest.java
@@ -61,9 +61,10 @@ List<Throwable> causes = causesOf(assertThrows(JsonbException.class, () -> defaultJsonb.fromJson(JSON, BrokenSetterPojo.class))); - String expectedMessage = "Error setting value on: " + BrokenSetterPojo.class.getName(); - assertTrue(causes.stream().anyMatch(cause -> expectedMessage.equals(cause.getMessage())), - "No exception with the message: " + expectedMessage); + String className = BrokenSetterPojo.class.getName(); + assertTrue(causes.stream().anyMatch(cause -> cause.getMessage() != null + && cause.getMessage().contains(className)), + "No exception whose message contains class name: " + className); } private static List<Throwable> causesOf(Throwable throwable) {
diff --git a/src/test/java/org/eclipse/yasson/defaultmapping/specific/RecursiveReferenceTest.java b/src/test/java/org/eclipse/yasson/defaultmapping/specific/RecursiveReferenceTest.java index 67872ab..2f9686b 100644 --- a/src/test/java/org/eclipse/yasson/defaultmapping/specific/RecursiveReferenceTest.java +++ b/src/test/java/org/eclipse/yasson/defaultmapping/specific/RecursiveReferenceTest.java
@@ -1,5 +1,6 @@ /* * Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026 Contributors to the Eclipse Foundation * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -13,6 +14,7 @@ package org.eclipse.yasson.defaultmapping.specific; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import java.util.Arrays; @@ -48,9 +50,9 @@ Jsonbs.defaultJsonb.toJson(recursive); fail("Exception should be caught"); } catch (JsonbException e) { - assertEquals( - "Unable to serialize property 'linksTo' from org.eclipse.yasson.adapters.model.Chain", - e.getMessage()); + assertTrue(e.getMessage().contains("linksTo"), "Message missing property name: " + e.getMessage()); + assertTrue(e.getMessage().contains("org.eclipse.yasson.adapters.model.Chain"), + "Message missing class name: " + e.getMessage()); assertEquals( "Recursive reference has been found in class org.eclipse.yasson.adapters.model.Chain.", e.getCause().getMessage());