aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-09-25 21:01:24 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-09-26 08:31:13 +0900
commitdbabe5f37a547ea1557ad0eedd9cc5d525a1c1ff (patch)
tree836904d10185d572403cfa8876b6ed154b7eed18 /org.eclipse.jgit.test
parent2f1350c9ac51f421e5642915716f43e732c4eb14 (diff)
downloadjgit-dbabe5f37a547ea1557ad0eedd9cc5d525a1c1ff.tar.gz
jgit-dbabe5f37a547ea1557ad0eedd9cc5d525a1c1ff.zip
Explicitly specify charset in constructor of InputStreamReader
Change-Id: Id43e27c590f41f7435c2ca1d127f27e45745da7f Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateParserTest.java3
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateStoreTest.java5
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/IOReadLineTest.java3
3 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateParserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateParserTest.java
index 0647167eab..4bf26b6288 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateParserTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateParserTest.java
@@ -42,6 +42,7 @@
package org.eclipse.jgit.transport;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
@@ -334,7 +335,7 @@ public class PushCertificateParserTest {
assertFalse(input.contains(PushCertificateParser.END_CERT));
input += input;
Reader reader = new InputStreamReader(
- new ByteArrayInputStream(Constants.encode(input)));
+ new ByteArrayInputStream(Constants.encode(input)), UTF_8);
assertNotNull(PushCertificateParser.fromReader(reader));
assertNotNull(PushCertificateParser.fromReader(reader));
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateStoreTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateStoreTest.java
index 68e0129525..fa4fd65069 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateStoreTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushCertificateStoreTest.java
@@ -43,6 +43,7 @@
package org.eclipse.jgit.transport;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.eclipse.jgit.lib.ObjectId.zeroId;
import static org.eclipse.jgit.lib.RefUpdate.Result.FAST_FORWARD;
import static org.eclipse.jgit.lib.RefUpdate.Result.LOCK_FAILURE;
@@ -96,7 +97,9 @@ public class PushCertificateStoreTest {
+ "-----END PGP SIGNATURE-----\n");
try {
return PushCertificateParser.fromReader(new InputStreamReader(
- new ByteArrayInputStream(Constants.encode(cert.toString()))));
+ new ByteArrayInputStream(
+ Constants.encode(cert.toString())),
+ UTF_8));
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/IOReadLineTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/IOReadLineTest.java
index 928fb2ed9a..fa303ec286 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/IOReadLineTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/IOReadLineTest.java
@@ -43,6 +43,7 @@
package org.eclipse.jgit.util;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import java.io.BufferedReader;
@@ -105,7 +106,7 @@ public class IOReadLineTest {
private Reader newReader(String in) {
Reader r = new InputStreamReader(
- new ByteArrayInputStream(Constants.encode(in)));
+ new ByteArrayInputStream(Constants.encode(in)), UTF_8);
if (buffered) {
r = new BufferedReader(r);
}