Skip to content

Commit 78f37ad

Browse files
committed
Revert a change to assertBodyFile.
We can't really know when to trim, and if there are body args, it won't trim the resulting rendered template anyway. We could add more methods, but it will sort of have to be up to the caller if they want to trim or not.
1 parent 170be1d commit 78f37ad

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

build.savant

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ logbackVersion = "1.4.14"
2929
slf4jVersion = "2.0.13"
3030
testngVersion = "7.8.0"
3131

32-
project(group: "org.primeframework", name: "prime-mvc", version: "4.33.0", licenses: ["ApacheV2_0"]) {
32+
project(group: "org.primeframework", name: "prime-mvc", version: "4.33.1", licenses: ["ApacheV2_0"]) {
3333
workflow {
3434
fetch {
3535
// Dependency resolution order:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.primeframework</groupId>
77
<artifactId>prime-mvc</artifactId>
8-
<version>4.33.0</version>
8+
<version>4.33.1</version>
99
<packaging>jar</packaging>
1010

1111
<name>FusionAuth App</name>

src/test/java/org/primeframework/mvc/GlobalTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ public Object[][] get_freemarker_escape_parameters() {
684684
public void get_fullFormWithAllAttributes() throws Exception {
685685
simulator.test("/user/full-form")
686686
.get()
687-
.assertBodyFile(Path.of("src/test/resources/html/full-form.html"));
687+
.assertBody(Files.readString(Path.of("src/test/resources/html/full-form.html")).trim());
688688
}
689689

690690
@Test
@@ -889,7 +889,7 @@ public void get_message_callback() throws Exception {
889889
public void get_metrics() throws Exception {
890890
simulator.test("/user/full-form")
891891
.get()
892-
.assertBodyFile(Path.of("src/test/resources/html/full-form.html"));
892+
.assertBody(Files.readString(Path.of("src/test/resources/html/full-form.html")).trim());
893893

894894
Map<String, Timer> timers = metricRegistry.getTimers();
895895
assertEquals(timers.get("prime-mvc.[/user/full-form].requests").getCount(), 1);
@@ -1322,7 +1322,7 @@ public void get_wellKnownDotPrefixed() throws Exception {
13221322

13231323
@Test
13241324
public void hacked() {
1325-
// Make sure we don't invoke 'freemarker.template.utility.Execute"
1325+
// Make sure we don't invoke "freemarker.template.utility.Execute"
13261326
simulator.test("/hacked")
13271327
.get()
13281328
.assertStatusCode(500)

src/test/java/org/primeframework/mvc/test/RequestResult.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ public RequestResult assertBodyDoesNotContainMessagesFromKeys(String... keys) {
385385
*/
386386
public RequestResult assertBodyFile(Path path, Object... values) throws IOException {
387387
if (values.length == 0) {
388-
var body = Files.readString(path).trim();
389-
return assertBody(body);
388+
return assertBody(Files.readString(path));
390389
}
391390
return assertBody(BodyTools.processTemplateForAssertion(path, values));
392391
}

0 commit comments

Comments
 (0)