From 050166b406e3eff97f358eddbf332c5554890495 Mon Sep 17 00:00:00 2001 From: Varsha C L Date: Mon, 2 Sep 2024 11:10:34 -0500 Subject: [PATCH] test(flaky): fix paramter type assert in testBothAnnotatedConstructor test case --- .../weld/internal/injector/CachedConstructorAnalyzerTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/internal/injector/CachedConstructorAnalyzerTest.java b/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/internal/injector/CachedConstructorAnalyzerTest.java index 10e10aecd0..9a3d7886ef 100644 --- a/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/internal/injector/CachedConstructorAnalyzerTest.java +++ b/incubator/cdi-inject-weld/src/test/java/org/glassfish/jersey/inject/weld/internal/injector/CachedConstructorAnalyzerTest.java @@ -30,6 +30,7 @@ import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Tests {@link CachedConstructorAnalyzer}. @@ -110,7 +111,8 @@ public void testBothAnnotatedConstructor() { Constructor constructor = analyzer.getConstructor(); assertEquals(1, constructor.getParameterCount()); - assertEquals(Integer.class, constructor.getParameterTypes()[0]); + Class parameterType = constructor.getParameterTypes()[0]; + assertTrue(parameterType.equals(Integer.class) || parameterType.equals(String.class)); } @Test