From 22678aa28184b719e27295b1780c8f0fad57d848 Mon Sep 17 00:00:00 2001 From: Gerald Madlmayr Date: Sun, 23 Sep 2018 12:47:28 +0200 Subject: [PATCH] Fix test to run on environments with German locale (#473) --- .../java/com/google/api/client/http/HttpResponseTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/google-http-client/src/test/java/com/google/api/client/http/HttpResponseTest.java b/google-http-client/src/test/java/com/google/api/client/http/HttpResponseTest.java index e6088ee33..6f6835d88 100644 --- a/google-http-client/src/test/java/com/google/api/client/http/HttpResponseTest.java +++ b/google-http-client/src/test/java/com/google/api/client/http/HttpResponseTest.java @@ -26,6 +26,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.Type; +import java.text.NumberFormat; import java.util.Arrays; import java.util.logging.Level; import junit.framework.TestCase; @@ -343,8 +344,9 @@ public void testContentLoggingLimitWithLoggingEnabledAndDisabled() throws Except char[] a = new char[18000]; Arrays.fill(a, 'x'); String big = new String(a); - subtestContentLoggingLimit(big, Integer.MAX_VALUE, true, "Total: 18,000 bytes", big); - subtestContentLoggingLimit(big, 4, true, "Total: 18,000 bytes (logging first 4 bytes)", "xxxx"); + String formated18kInteger = NumberFormat.getInstance().format(18000); + subtestContentLoggingLimit(big, Integer.MAX_VALUE, true, String.format("Total: %s bytes", formated18kInteger), big); + subtestContentLoggingLimit(big, 4, true, String.format("Total: %s bytes (logging first 4 bytes)", formated18kInteger), "xxxx"); } public void subtestContentLoggingLimit(final String content, int contentLoggingLimit,