You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2018/08/09 19:19:13 UTC
[camel] branch master updated: Fixed a test failing on jenkins
where default encoding is ISO-8859-1
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 824047d Fixed a test failing on jenkins where default encoding is ISO-8859-1
824047d is described below
commit 824047d8b5498080a6ad6f423087e18c307e47dd
Author: aldettinger <al...@gmail.com>
AuthorDate: Thu Aug 9 21:16:33 2018 +0200
Fixed a test failing on jenkins where default encoding is ISO-8859-1
---
.../dataformat/xmlsecurity/XMLSecurityDataFormatTest.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java
index 7a69370..d48c498 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/dataformat/xmlsecurity/XMLSecurityDataFormatTest.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.dataformat.xmlsecurity;
+import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@@ -32,6 +33,7 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.converter.jaxp.XmlConverter;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.camel.util.jsse.KeyStoreParameters;
+import org.apache.commons.codec.Charsets;
import org.apache.xml.security.encryption.XMLCipher;
import org.junit.Assert;
@@ -151,12 +153,11 @@ public class XMLSecurityDataFormatTest extends CamelTestSupport {
(byte)0x30, (byte)0xd4, (byte)0x3d, (byte)0xf5,
(byte)0x6d, (byte)0xaa, (byte)0x7d, (byte)0xc2,
(byte)0x85, (byte)0x32, (byte)0x2a, (byte)0xb6,
- (byte)0xfe, (byte)0xed, (byte)0xbe, (byte)0xef
- };
-
+ (byte)0xfe, (byte)0xed, (byte)0xbe, (byte)0xef};
- final String passCode = new String(bits192);
- byte[] bytes = passCode.getBytes();
+ final Charset passCodeCharset = Charsets.UTF_8;
+ final String passCode = new String(bits192, passCodeCharset);
+ byte[] bytes = passCode.getBytes(passCodeCharset);
assertTrue(bits192.length != bytes.length);
context.addRoutes(new RouteBuilder() {
public void configure() {