Make implausibly long @Timeout values explicit in minutes

MSAL

JUnit Jupiter's @Timeout defaults to TimeUnit.SECONDS, so a value such as @Timeout(7200) is interpreted as two hours, which is most likely a mistake where milliseconds were intended. This recipe rewrites such implausibly large second-based timeouts to the equivalent number of minutes, for instance @Timeout(value = 120, unit = TimeUnit.MINUTES), preserving the original (likely erroneous) semantics while making the mistake far more visible for review. Other attributes such as threadMode are kept, and values that are not a whole number of minutes are left unchanged, since rounding them would change the timeout.

org.openrewrite.java.testing.junit5.ImplausibleTimeoutToMinutes

Optional

Timeouts of at least this many seconds (when the time unit is the default SECONDS) are considered implausibly long and are rewritten to the equivalent number of minutes, when they are a whole number of minutes. Defaults to 1000 seconds, about 17 minutes.

mod run . --recipe=org.openrewrite.java.testing.junit5.ImplausibleTimeoutToMinutes

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.