From cad8b2ac84dac80b4bb67ea957d98f21f308fedf Mon Sep 17 00:00:00 2001 From: Alex Maltsev Date: Fri, 15 Jul 2022 18:36:33 +0300 Subject: [PATCH] Fixed unwanted VAST XML linebreaks --- .../org/prebid/server/vast/VastModifier.java | 8 ++--- .../prebid/server/vast/VastModifierTest.java | 34 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/main/java/org/prebid/server/vast/VastModifier.java b/src/main/java/org/prebid/server/vast/VastModifier.java index b9633c6c977..ce80078bfc1 100644 --- a/src/main/java/org/prebid/server/vast/VastModifier.java +++ b/src/main/java/org/prebid/server/vast/VastModifier.java @@ -94,10 +94,10 @@ public String createBidVastXml(String bidder, private static String resolveVastXmlFrom(String bidAdm, String bidNurl) { return StringUtils.isEmpty(bidAdm) && bidNurl != null ? """ - - prebid.org wrapper - - + \ + prebid.org wrapper\ + \ + \ """.formatted(bidNurl) : bidAdm; } diff --git a/src/test/java/org/prebid/server/vast/VastModifierTest.java b/src/test/java/org/prebid/server/vast/VastModifierTest.java index 74deffcd33a..5593a535028 100644 --- a/src/test/java/org/prebid/server/vast/VastModifierTest.java +++ b/src/test/java/org/prebid/server/vast/VastModifierTest.java @@ -109,10 +109,13 @@ public void modifyVastXmlShouldModifyVastAndAppendUrl() { INTEGRATION); // then - final String modifiedVast = "prebid.org wrapper" - + "" - + "" - + ""; + final String modifiedVast = + """ + prebid.org wrapper\ + \ + \ + \ + """; assertThat(result).isEqualTo(new TextNode(modifiedVast)); } @@ -341,20 +344,23 @@ private static TextNode nodeAdm() { } public static String adm() { - return "" - + "prebid.org wrapper" - + "" - + "" - + ""; + return """ + \ + prebid.org wrapper\ + \ + \ + \ + """; } private static String modifiedAdm(String bidNurl) { return """ - - prebid.org wrapper - - - """.formatted(bidNurl); + \ + prebid.org wrapper\ + \ + \ + \ + """.formatted(bidNurl); } private static EventsContext givenEventsContext(boolean accountEnabled) {