Skip to content

Commit 82b03dc

Browse files
committed
junit fix and refactoring
1 parent abd49d7 commit 82b03dc

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

java/src/main/java/com/cybersource/ws/client/Utility.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import javax.xml.transform.dom.DOMSource;
3131
import javax.xml.transform.stream.StreamResult;
3232
import java.io.*;
33-
import java.net.InetAddress;
34-
import java.net.UnknownHostException;
3533
import java.util.HashMap;
3634
import java.util.Iterator;
3735
import java.util.Map;

java/src/main/java/com/cybersource/ws/client/XMLClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public static Document runTransaction(
178178
}
179179
}
180180

181-
setVersionInformation(request, nsURI, mc.retryIfMTIFieldExistEnabled());
181+
setVersionInformation(request, nsURI);
182182

183183
DocumentBuilder builder = Utility.newDocumentBuilder();
184184

@@ -269,7 +269,7 @@ private static void setMerchantID(
269269
* @param request request to set the version information in.
270270
* @param nsURI namespaceURI to use.
271271
*/
272-
private static void setVersionInformation(Document request, String nsURI, boolean isAddingMTIEnabled) {
272+
private static void setVersionInformation(Document request, String nsURI) {
273273
//
274274
// First, delete the version fields currently in the request document,
275275
// if any.

java/src/test/java/com/cybersource/ws/client/ClientTest.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package com.cybersource.ws.client;
22

3-
import org.junit.Assert;
4-
import org.junit.Before;
5-
import org.junit.BeforeClass;
6-
import org.junit.Test;
3+
import org.junit.*;
74

85
import java.io.IOException;
96
import java.io.InputStream;
@@ -17,7 +14,17 @@
1714
public class ClientTest extends BaseTest {
1815

1916
Map<String, String> request = getSampleRequest();
17+
Properties orgMerchantProps = new Properties();
18+
@Before
19+
public void setup(){
20+
orgMerchantProps.putAll(merchantProperties);
21+
}
2022

23+
@After
24+
public void tearDown(){
25+
merchantProperties.clear();
26+
merchantProperties.putAll(orgMerchantProps);
27+
}
2128
@Test
2229
public void testSetVersionInformation() throws InvocationTargetException {
2330
Class[] argClasses = {Map.class};

0 commit comments

Comments
 (0)