Skip to content

Commit e601d7d

Browse files
geri-mchingor13
authored andcommitted
Fix test to run on environments with German locale (#473) (#474)
1 parent 7a1fa3b commit e601d7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

google-http-client/src/test/java/com/google/api/client/http/HttpResponseTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.io.ByteArrayOutputStream;
2727
import java.io.IOException;
2828
import java.lang.reflect.Type;
29+
import java.text.NumberFormat;
2930
import java.util.Arrays;
3031
import java.util.logging.Level;
3132
import junit.framework.TestCase;
@@ -343,8 +344,9 @@ public void testContentLoggingLimitWithLoggingEnabledAndDisabled() throws Except
343344
char[] a = new char[18000];
344345
Arrays.fill(a, 'x');
345346
String big = new String(a);
346-
subtestContentLoggingLimit(big, Integer.MAX_VALUE, true, "Total: 18,000 bytes", big);
347-
subtestContentLoggingLimit(big, 4, true, "Total: 18,000 bytes (logging first 4 bytes)", "xxxx");
347+
String formated18kInteger = NumberFormat.getInstance().format(18000);
348+
subtestContentLoggingLimit(big, Integer.MAX_VALUE, true, String.format("Total: %s bytes", formated18kInteger), big);
349+
subtestContentLoggingLimit(big, 4, true, String.format("Total: %s bytes (logging first 4 bytes)", formated18kInteger), "xxxx");
348350
}
349351

350352
public void subtestContentLoggingLimit(final String content, int contentLoggingLimit,

0 commit comments

Comments
 (0)