On Wed, 14 Jun 2023 22:48:34 GMT, Maurizio Cimadamore <[email protected]>
wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> formatting
>
> test/jdk/java/foreign/TestLayoutPaths.java line 152:
>
>> 150: String expectedMessage = "Target offset incompatible with
>> alignment constraints: " + struct.byteAlignment();
>> 151:
>> 152: try {
>
> Can assertThrows be used to simplify this pattern?
Yeah. I thought `assertThrows` was only a junit thing, but it looks like TestNG
also has an `expectThrows` which does the same and returns the thrown exception
so that we can check the message.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14475#discussion_r1230267718