On Wed, 14 May 2025 17:04:01 GMT, Lance Andersen <lan...@openjdk.org> wrote:
>> David Beaumont has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix comment based on current behaviour. > > test/jdk/jdk/nio/zipfs/NewFileSystemTests.java line 207: > >> 205: Map.of("create", true, "accessMode", >> "badValue"))); >> 206: } >> 207: > > You could simplify the above tests using a DataProvider similar to > > @DataProvider(name = "zipfsMap") > protected Object[][] zipfsMap() { > return new Object[][]{ > {Map.of(), NoSuchFileException.class}, > {Map.of("accessMode", "readOnly"), NoSuchFileException.class}, > {Map.of("accessMode", "readWrite"), NoSuchFileException.class}, > {Map.of("create", true, "accessMode", "readOnly"), > IllegalArgumentException.class}, > {Map.of("create", true, "accessMode", "badValue"), > IllegalArgumentException.class}, > }; > @Test(dataProvider = "zipfsMapā) > public void testZipFSCreationException(Map<String, String> env, Class<T> > exception) throws Exception { > assertThrows(exception, () -> FileSystems.newFileSystem(noSuchZip, > env)); > } Done. Thanks for giving the example, it really helped. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25178#discussion_r2091698261