Skip to content

Commit a8f5a76

Browse files
committed
build(tests): add a more verbose SwordConfiguration useable for tests #2
1 parent 783b08a commit a8f5a76

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

src/main/java/org/swordapp/server/ErrorDocument.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void writeTo(final Writer out, final SwordConfiguration config) throws Sw
145145
TransformerFactory transformerFactory = TransformerFactory.newInstance();
146146
Transformer transformer = transformerFactory.newTransformer();
147147
DOMSource source = new DOMSource(doc);
148-
transformer.setOutputProperty(OutputKeys.STANDALONE, "no");
148+
transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
149149
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
150150
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
151151
transformer.transform(source, new StreamResult(out));
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package org.swordapp.server;
2+
3+
public class SwordTestConfiguration implements SwordConfiguration {
4+
public boolean returnDepositReceipt() {
5+
return true;
6+
}
7+
8+
public boolean returnStackTraceInError() {
9+
return true;
10+
}
11+
12+
public boolean returnErrorBody() {
13+
return true;
14+
}
15+
16+
public String generator() {
17+
return "http://www.swordapp.org/";
18+
}
19+
20+
public String generatorVersion() {
21+
return "2.0";
22+
}
23+
24+
public String administratorEmail() {
25+
26+
}
27+
28+
public String getAuthType() {
29+
return "None";
30+
}
31+
32+
public boolean storeAndCheckBinary() {
33+
return true;
34+
}
35+
36+
public String getTempDirectory() {
37+
return System.getProperty("java.io.tmpdir");
38+
}
39+
40+
public int getMaxUploadSize() {
41+
return 1024;
42+
}
43+
44+
public String getAlternateUrl() {
45+
return "https://example.org";
46+
}
47+
48+
public String getAlternateUrlContentType() {
49+
return "text/html";
50+
}
51+
52+
public boolean allowUnauthenticatedMediaAccess() {
53+
return false;
54+
}
55+
}

0 commit comments

Comments
 (0)