aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/at/gv/egiz/moazs/TestUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/at/gv/egiz/moazs/TestUtils.java')
-rw-r--r--src/test/java/at/gv/egiz/moazs/TestUtils.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/java/at/gv/egiz/moazs/TestUtils.java b/src/test/java/at/gv/egiz/moazs/TestUtils.java
index 96d3a22..8120af1 100644
--- a/src/test/java/at/gv/egiz/moazs/TestUtils.java
+++ b/src/test/java/at/gv/egiz/moazs/TestUtils.java
@@ -2,6 +2,9 @@ package at.gv.egiz.moazs;
import org.apache.commons.io.FileUtils;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
import java.io.File;
import java.io.IOException;
import java.net.URI;
@@ -9,6 +12,7 @@ import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
+import java.util.GregorianCalendar;
import static java.net.http.HttpResponse.BodyHandlers.ofString;
@@ -33,4 +37,13 @@ public class TestUtils {
return client.send(request, ofString());
}
+
+ public static XMLGregorianCalendar genTimeStamp() {
+ try {
+ return DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
+ } catch (DatatypeConfigurationException e) {
+ throw new RuntimeException("ups");
+ }
+
+ }
}