use more of StandardCharsets (#952)

* use more of StandardCharsets

* scalafmt
This commit is contained in:
PJ Fanning 2024-01-14 23:50:50 +01:00 committed by GitHub
parent 485639ef82
commit 8c688dad2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 68 additions and 46 deletions

View file

@ -15,6 +15,7 @@ package org.apache.pekko.testkit
import java.io._
import java.lang.management.ManagementFactory
import java.nio.charset.StandardCharsets
import java.util.concurrent.Semaphore
import java.util.concurrent.locks.ReentrantLock
@ -28,9 +29,9 @@ class CoronerSpec extends AnyWordSpec with Matchers {
private def captureOutput[A](f: PrintStream => A): (A, String) = {
val bytes = new ByteArrayOutputStream()
val out = new PrintStream(bytes, true, "UTF-8")
val out = new PrintStream(bytes, true, StandardCharsets.UTF_8.name)
val result = f(out)
(result, new String(bytes.toByteArray(), "UTF-8"))
(result, bytes.toString(StandardCharsets.UTF_8.name))
}
"A Coroner" must {