some more tests

This commit is contained in:
Andreas Penski (init) 2020-04-30 14:28:51 +02:00
parent fcf3ff2bf1
commit 16dc45ab46
11 changed files with 257 additions and 46 deletions

View file

@ -3,23 +3,25 @@ package de.kosit.validationtool.impl;
import java.util.Date;
import java.util.GregorianCalendar;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import lombok.SneakyThrows;
/**
* @author Andreas Penski
*/
public class DateFactory {
private DateFactory() {
// hide
}
@SneakyThrows
public static XMLGregorianCalendar createTimestamp() {
try {
final GregorianCalendar cal = new GregorianCalendar();
cal.setTime(new Date());
return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
} catch (final DatatypeConfigurationException e) {
throw new IllegalStateException("Can not create timestamp", e);
}
}
}