From c9d827ca11a571905793c365b3be912aeef8bc49 Mon Sep 17 00:00:00 2001 From: Philippe Marschall Date: Wed, 1 Sep 2021 11:40:32 +0200 Subject: [PATCH] Avoid string conversion in ExecutionContextSerializer tests Avoid the byte to string to byte conversion in AbstractExecutionContextSerializerTests. --- .../dao/AbstractExecutionContextSerializerTests.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractExecutionContextSerializerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractExecutionContextSerializerTests.java index 50a8d8e2e0..871a7e20c6 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractExecutionContextSerializerTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/repository/dao/AbstractExecutionContextSerializerTests.java @@ -166,9 +166,7 @@ protected Map serializationRoundTrip(Map m1) thr ByteArrayOutputStream out = new ByteArrayOutputStream(); getSerializer().serialize(m1, out); - String s = new String(out.toByteArray(), "ISO-8859-1"); - - InputStream in = new ByteArrayInputStream(s.getBytes("ISO-8859-1")); + InputStream in = new ByteArrayInputStream(out.toByteArray()); Map m2 = getSerializer().deserialize(in); return m2; }