Unified validation methods

This commit is contained in:
Philip Helger
2024-07-09 17:53:41 +02:00
parent 8ed25ce8be
commit 75f37846eb
2 changed files with 75 additions and 153 deletions

View File

@@ -13,15 +13,15 @@ public class MiscValidatorTest extends ResourceCase {
ZUGFeRDValidator zfv=new ZUGFeRDValidator();
String res=zfv.validate(null);
assertTrue(res.matches("<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>\n" +
"\n" +
"<validation filename=\"\" datetime=\".*?\">\n" +
" <messages>\n" +
" <error type=\"10\">Filename not specified</error> \n" +
" </messages>\n" +
" <summary status=\"invalid\"/>\n" +
"</validation>\n" +
""));
assertTrue(res.matches("<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>\n" +
"\n" +
"<validation filename=\"\" datetime=\".*?\">\n" +
" <messages>\n" +
" <error type=\"10\">Filename not specified</error> \n" +
" </messages>\n" +
" <summary status=\"invalid\"/>\n" +
"</validation>\n" +
""));
res=zfv.validate("/dhfkbv/sfjkh");
assertTrue(res.matches("<\\?xml version=\"1.0\" encoding=\"UTF-8\"\\?>\n" +