From 92cc4f8597e3cbef36addb8ec2d1829e285daf80 Mon Sep 17 00:00:00 2001 From: jdyer1 Date: Mon, 6 Nov 2023 15:11:11 -0600 Subject: [PATCH] WN-5141 - fix expected message text from library --- .../apache/struts2/interceptor/CookieInterceptorTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/org/apache/struts2/interceptor/CookieInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/CookieInterceptorTest.java index 86bbfe798..4b22b1dd5 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/CookieInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/CookieInterceptorTest.java @@ -343,28 +343,28 @@ public class CookieInterceptorTest extends StrutsInternalTestCase { new Cookie(pollution1, "pollution1"); fail("It shouldn't be possible to create cookie: " + pollution1); } catch (IllegalArgumentException e) { - assertEquals(e.getMessage(), "Cookie name \"" + pollution1 + "\" is a reserved token"); + assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution1 + "\" is a reserved token")); } try { new Cookie(pollution4, "pollution4"); fail("It shouldn't be possible to create cookie: " + pollution4); } catch (IllegalArgumentException e) { - assertEquals(e.getMessage(), "Cookie name \"" + pollution4 + "\" is a reserved token"); + assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution4 + "\" is a reserved token")); } try { new Cookie(pollution5, "pollution5"); fail("It shouldn't be possible to create cookie: " + pollution5); } catch (IllegalArgumentException e) { - assertEquals(e.getMessage(), "Cookie name \"" + pollution5 + "\" is a reserved token"); + assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution5 + "\" is a reserved token")); } try { new Cookie(pollution6, "pollution6"); fail("It shouldn't be possible to create cookie: " + pollution6); } catch (IllegalArgumentException e) { - assertEquals(e.getMessage(), "Cookie name \"" + pollution6 + "\" is a reserved token"); + assertTrue(e.getMessage(), e.getMessage().startsWith("Cookie name \"" + pollution6 + "\" is a reserved token")); } request.setCookies(