Skip to content

Commit

Permalink
CU-86b14j4e0_check-code-security-reports-at-GitHub-for-all-repos
Browse files Browse the repository at this point in the history
  • Loading branch information
ptorres-prowide committed Sep 17, 2024
1 parent 39307a3 commit ec45720
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ public void test103_1() throws IOException {

SwiftMessage m = new SwiftParser(messageToParse).message();

// get a simple value tag
@SuppressWarnings("unused")
String val32a = m.getBlock3().getTagValue("32A");

// get a repeated value tag
@SuppressWarnings("unused")
String[] list71 = m.getBlock3().getTagValues("71F");

assertEquals("103", m.getType());

// check b1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ public void setUp() {

@SuppressWarnings("unused")
private String getResult() {
return this.getResult("");
}

private String getResult(String testName) {
msg.visit(visitor);
return this.io.toString();
}
Expand All @@ -69,7 +65,7 @@ public void testEmpty() {
msg.setBlock4(null);
msg.setBlock5(null);

assertXmlEqual("<message/>", getResult("testEmpty"));
assertXmlEqual("<message/>", getResult());
}

@Test
Expand All @@ -86,7 +82,7 @@ public void testEmptyBlocks() {
msg.setBlock5(new SwiftBlock5());

String xml = "<message><block1/>\n<block2/>\n<block3/>\n<block4/>\n<block5/>\n</message>";
assertXmlEqual(xml, getResult("testEmptyBlocks"));
assertXmlEqual(xml, getResult());
}

@Test
Expand All @@ -106,7 +102,7 @@ public void testWithTags() {
b4.append(new Tag("t1:v1"));
msg.setBlock1(b1);
msg.setBlock4(b4);
assertXmlEqual(xml, getResult("testWithTags"));
assertXmlEqual(xml, getResult());
}

@Test
Expand All @@ -120,7 +116,7 @@ public void testBug1539324_1() {
msg.setBlock2(b2);

String xml = "<message>\n" + Constants.B1_DATA_XML + Constants.B2_INPUT_XML + "</message>";
assertXmlEqual(xml, getResult("testBug1539324_1"));
assertXmlEqual(xml, getResult());
}

@Test
Expand Down Expand Up @@ -149,7 +145,7 @@ public void testBug1539324_2() {
+ "\n<block4>\n</block4>"
+ "\n<block5>\n</block5>"
+ "\n</message>";
assertXmlEqual(xml, getResult("testBug1539324_2"));
assertXmlEqual(xml, getResult());
}

@Test
Expand All @@ -171,7 +167,7 @@ public void testBug1540294_1() {
+ "\n\t</tag>"
+ "\n</block4>"
+ "</message>";
assertXmlEqual(xml, getResult("testBug1540294_1"));
assertXmlEqual(xml, getResult());
}

@Test
Expand All @@ -186,7 +182,7 @@ public void testBlock2Output_1() {
msg.setBlock2(b2);

String xml = "<message>\n" + Constants.B1_DATA_XML + Constants.B2_OUTPUT_XML + "</message>";
assertXmlEqual(xml, getResult("testBlock2Output_1"));
assertXmlEqual(xml, getResult());
}

@Test
Expand All @@ -198,7 +194,7 @@ public void testBlock2Output() {
msg.setBlock2(b2);

String xml = "<message>\n" + Constants.B2_OUTPUT_XML + "</message>";
String got = getResult("testBlock2Output");
String got = getResult();
assertXmlEqual(xml, got);
}

Expand All @@ -216,7 +212,7 @@ public void testTagSerialization() {
+ "\n\t</tag>"
+ "\n</block4>"
+ "</message>";
assertXmlEqual(xml, getResult("testTagSerialization"));
assertXmlEqual(xml, getResult());
}

@Test
Expand All @@ -235,7 +231,7 @@ public void testFieldSerialization() {
+ "\n\t</tag>"
+ "\n</block4>"
+ "</message>";
assertXmlEqual(xml, getResult("testFieldSerialization"));
assertXmlEqual(xml, getResult());
}

@Test
Expand All @@ -256,6 +252,6 @@ public void testWithTags_asField() {
msg.setBlock1(b1);
msg.setBlock4(b4);
this.visitor = new XMLWriterVisitor(this.io, true);
assertXmlEqual(xml, getResult("testWithTags"));
assertXmlEqual(xml, getResult());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ public void test_bug2822350() throws IOException {

SwiftMessage msg = SwiftMessage.parse(sb.toString());

@SuppressWarnings("unused")
SwiftMessage m2 = SwiftMessage.parse(msg.getUnparsedTexts().getText(0));

@SuppressWarnings("unused")
SwiftMessage m3 = SwiftMessage.parse(msg.getUnparsedTexts().getText(1));
assertNotNull(SwiftMessage.parse(msg.getUnparsedTexts().getText(0)));
assertNotNull(SwiftMessage.parse(msg.getUnparsedTexts().getText(1)));
}
}

0 comments on commit ec45720

Please sign in to comment.