Skip to content

Commit

Permalink
test(flaky): fix paramter type assert in testBothAnnotatedConstructor…
Browse files Browse the repository at this point in the history
… test case
  • Loading branch information
varsha-cl authored Oct 3, 2024
1 parent 87a68dd commit ef6418c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2022, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -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}.
Expand Down Expand Up @@ -110,7 +111,8 @@ public void testBothAnnotatedConstructor() {

Constructor<BothAnnotatedConstructor> constructor = analyzer.getConstructor();
assertEquals(1, constructor.getParameterCount());
assertEquals(Integer.class, constructor.getParameterTypes()[0]);
Class<?> parameterType = constructor.getParameterTypes()[0];
assertTrue(parameterType.equals(String.class) || parameterType.equals(Integer.class));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -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}.
Expand Down Expand Up @@ -110,7 +111,8 @@ public void testBothAnnotatedConstructor() {

Constructor<BothAnnotatedConstructor> constructor = analyzer.getConstructor();
assertEquals(1, constructor.getParameterCount());
assertEquals(Integer.class, constructor.getParameterTypes()[0]);
Class<?> parameterType = constructor.getParameterTypes()[0];
assertTrue(parameterType.equals(String.class) || parameterType.equals(Integer.class));
}

@Test
Expand Down

0 comments on commit ef6418c

Please sign in to comment.