RFR: 8302983: ZoneRulesProvider.registerProvider() twice will remove provider [v2]
Madjosz
duke at openjdk.org
Fri Feb 24 19:53:02 UTC 2023
On Fri, 24 Feb 2023 19:35:29 GMT, Madjosz <duke at openjdk.org> wrote:
>> test/jdk/java/time/test/java/time/zone/TestZoneRulesProvider.java line 123:
>>
>>> 121: ZoneRulesProvider.registerProvider(provider);
>>> 122: assertTrue(ZoneId.getAvailableZoneIds().contains(zone), "Unexpected non-availability for " + zone);
>>> 123: assertNotNull(ZoneId.of(zone), "ZoneId instance for " + zone + " should be obtainable");
>>
>> If the `zone` does not exist, it will not return `null` but throw an exception. Assertion needs to be modified correctly.
>
> Which version of TestNG is used for JDK? In JUnit 5 I would just use `assertDoesNotThrow()` in such a case but TestNG seems to lack such method.
I just removed the non-`null` assertion as the fact that the call succeeds already is the thing we want to test here.
-------------
PR: https://git.openjdk.org/jdk/pull/12690
More information about the core-libs-dev
mailing list