On Fri, 6 Mar 2026 09:21:56 GMT, Raffaello Giulietti <[email protected]> 
wrote:

> A migration from TestNG to JUnit

test/jdk/java/util/Arrays/AsList.java line 44:

> 42: import org.junit.jupiter.params.provider.MethodSource;
> 43: 
> 44: @TestInstance(TestInstance.Lifecycle.PER_CLASS)

Just curious why this is needed as the method source is a static method.

test/jdk/java/util/Arrays/AsList.java line 60:

> 58:                 itr.remove();
> 59:                 fail("Remove must throw");
> 60:             } catch (UnsupportedOperationException ex) {

I assume a deeper migration would change this to 
`assertThrows(UnsupportedOperationException.class, itr::remove)`.

test/jdk/java/util/Arrays/AsList.java line 64:

> 62:             }
> 63:         }
> 64:         assertFalse(itr.hasNext());

In passing, I assume this assertFalse is redundant as it is checked in the loop.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30111#discussion_r2895115162
PR Review Comment: https://git.openjdk.org/jdk/pull/30111#discussion_r2895123132
PR Review Comment: https://git.openjdk.org/jdk/pull/30111#discussion_r2895130737

Reply via email to