summaryrefslogtreecommitdiffstats
path: root/proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java')
-rw-r--r--proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java b/proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java
index 4c5aba1..8c8ee90 100644
--- a/proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java
+++ b/proxy/code/src/org/fedoraproject/candlepin/test/TestUtil.java
@@ -27,6 +27,8 @@ import org.fedoraproject.candlepin.model.Owner;
import org.fedoraproject.candlepin.model.Product;
import org.fedoraproject.candlepin.model.User;
+import com.sun.jersey.core.util.Base64;
+
/**
* TestUtil for creating various testing objects.
*
@@ -107,5 +109,17 @@ public class TestUtil {
Date jsqlD = new Date(cal.getTime().getTime());
return jsqlD;
}
+
+ public static String xmlToBase64String(String xml) {
+
+ byte[] bytes = Base64.encode(xml);
+
+ StringBuffer buf = new StringBuffer();
+ for (byte b : bytes) {
+ buf.append((char) Integer.parseInt(Integer.toHexString(b), 16));
+ }
+
+ return buf.toString();
+ }
}