File tree Expand file tree Collapse file tree
java/src/test/java/com/cybersource/ws/client Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments