/*******************************************************************************
 * Copyright (c) 2017 Martin Weber.
 *
 * Contributors:
 *      Martin Weber - Initial implementation
 *******************************************************************************/
package net.schmizz.sshj.common;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import net.schmizz.sshj.SSHClient;

/**
 * @author Martin Weber
 */
public class SecurityUtilsTest {

  @Before
  public void setUp() throws Exception {
  }

  @Test
  public final void testBouncyCastleProvider() {
    SecurityUtils.setRegisterBouncyCastle(true);
    // trigger a net.schmizz.sshj.common.SSHRuntimeException caused by
    // a ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
    SecurityUtils.getSecurityProvider();
  }

}

@@ -327,37 +327,21 @@
 ert.
-*;%0A%0Aimport org.junit.Befor
+assertTru
 e;%0A
+%0A
 impo
@@ -364,44 +364,8 @@
 t;%0A%0A
-import net.schmizz.sshj.SSHClient;%0A%0A
 /**%0A
@@ -432,61 +432,173 @@
 %0A%0A  
-@Before%0A  public void setUp() throws Exception %7B%0A  %7D%0A
+/**%0A   * Tests whether bouncycastle providers can be instantiated (OSGI inhibited loding classes from BC jar, if packages are not imported in sshj%60s jar).%0A   *%0A   */
 %0A  @
@@ -854,24 +854,37 @@
 Provider%0A   
+ boolean res=
  SecurityUti
@@ -890,28 +890,71 @@
 ils.
-getSecurityProvider(
+isBouncyCastleRegistered();%0A    assertTrue(%22registered BC%22, res
 );%0A 

use isBouncyCastleRegistered() in test.