Skip to content

Commit efb1aa8

Browse files
committed
Added the testmerchantloadp12 file method and added threadsleep method
1 parent 1eb4459 commit efb1aa8

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

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

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.w3c.dom.NodeList;
3030
import org.xml.sax.InputSource;
3131

32+
import java.io.File;
3233
import java.io.InputStream;
3334
import java.io.StringReader;
3435
import java.security.KeyFactory;
@@ -119,6 +120,8 @@ public void testSoapWrapAndSign() throws Exception {
119120

120121
@Test
121122
public void testSoapWrapSignedAndEncrypt() throws Exception {
123+
Thread.sleep(30000);
124+
122125
Document signedDoc = SecurityUtil.createSignedDoc(wrappedDoc,config.getMerchantID(),config.getKeyPassword(),logger);
123126
NodeList signatureElement = signedDoc.getElementsByTagName("wsse:Security");
124127
assert (signatureElement.getLength() >= 1);
@@ -178,5 +181,28 @@ private static PrivateKey instPrivateKey(PrivateKey pkey) throws Exception{
178181
return privateKey;
179182
}
180183

184+
@Test
185+
public void testLoadMerchantP12File() throws Exception{
186+
187+
188+
Identity identity = Mockito.mock(Identity.class);
189+
//MerchantConfig config=Mockito.mock(MerchantConfig.class);
190+
File keyFile=config.getKeyFile();
191+
boolean value=(config.getMerchantID() == null || !(identity.isValid(keyFile)));
192+
assert(value==true);
193+
if (value == true) {
194+
195+
logger.log(Logger.LT_INFO, "Condition valid");
196+
197+
} else {
198+
199+
logger.log(Logger.LT_INFO, "Condition false");
200+
}
201+
202+
}
203+
204+
205+
}
206+
207+
181208

182-
}

0 commit comments

Comments
 (0)