@Test
public void testGetSessionOnSuccessCase()
    throws Exception
{

    // Mock objects
    File fileMock = mock( File.class );
    whenNew( File.class ).withArguments( anyString() ).thenReturn( fileMock );
    when( fileMock.exists() ).thenReturn( true );
    when( fileMock.isDirectory() ).thenReturn( false );
    Session session = mock( Session.class );
    JSch jsch = mock( JSch.class );
    whenNew( JSch.class ).withNoArguments().thenReturn( jsch );
    Mockito.doNothing().when( jsch ).setKnownHosts( anyString() );
    when( jsch.getSession( anyString(), anyString(), anyInt() ) ).thenReturn( session );
    // PowerMockito.mockStatic( StaticContextAccessor.class );
    // KeyStorePasswordProvider keyStorePasswordProvider = mock( KeyStorePasswordProvider.class );
    // when( StaticContextAccessor.getBean( KeyStorePasswordProvider.class ) ).thenReturn( keyStorePasswordProvider
    // );
    // when( keyStorePasswordProvider.getPassword() ).thenReturn( "****" );
    //
    // PowerMockito.mockStatic( CipherServiceUtil.class );
    // when( CipherServiceUtil.getDecryptedProperty( any( String.class ) ) ).thenReturn( "****" );
    Properties config = new Properties();
    config.put( "StrictHostKeyChecking", "yes" );
    Session sessionObj = EsxiSshUtil.getSessionObject( "user", "password", "127.0.0.1", 22, config );
    assertNotNull( sessionObj );
}