Skip to content

Commit 44a1134

Browse files
committed
another junit fix
1 parent e42725a commit 44a1134

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,20 @@ public void testMerchantIdentityToKeyStore() throws Exception{
163163

164164
Mockito.when(identity.getPrivateKey()).thenReturn(newPkay);
165165
Mockito.when(identity.getX509Cert()).thenReturn(x509Cert);
166-
Mockito.when(identity.getName()).thenReturn("MahenCertTest");
167166
Mockito.when(identity.getKeyAlias()).thenReturn("MahenCertTest");
167+
Mockito.when(identity.getPswd()).thenReturn("testPwd".toCharArray());
168168

169169
MessageHandlerKeyStore mhKeyStore= new MessageHandlerKeyStore();
170+
170171
MessageHandlerKeyStore spyMhKeyStore = Mockito.spy(mhKeyStore);
171172
Mockito.when(spyMhKeyStore.getKeyStore()).thenReturn(myKeystore);
172173
spyMhKeyStore.addIdentityToKeyStore(identity,logger);
174+
175+
Mockito.verify(identity,times(1)).getKeyAlias();
176+
Mockito.verify(identity,times(1)).getPrivateKey();
177+
Mockito.verify(identity,times(1)).getPswd();
178+
Mockito.verify(identity,times(1)).getX509Cert();
179+
173180
}
174181

175182
@Test

0 commit comments

Comments
 (0)