mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
17.13.2015 1047879fdacd5d6ba1ac8c301b885c8b7ec886f6
Fix NPE in tests

JmxTestCase.java:
Do not use SoftAssertions, it was a bad idea.
1 files modified
14 ■■■■ changed files
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxTestCase.java 14 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxTestCase.java
@@ -36,7 +36,7 @@
import java.util.List;
import java.util.concurrent.Callable;
import org.assertj.core.api.SoftAssertions;
import org.assertj.core.api.Assertions;
import org.opends.server.DirectoryServerTestCase;
import org.opends.server.TestCaseUtils;
import org.opends.server.api.ConnectionHandler;
@@ -98,22 +98,14 @@
      @Override
      public Void call() throws Exception
      {
        SoftAssertions softly = new SoftAssertions();
        softly.assertThat(rmiConnector.jmxRmiConnectorNoClientCertificate).isNotNull();
        softly.assertThat(rmiConnector.jmxRmiConnectorNoClientCertificate.isActive()).isTrue();
        softly.assertAll();
        Assertions.assertThat(rmiConnector.jmxRmiConnectorNoClientCertificate).isNotNull();
        Assertions.assertThat(rmiConnector.jmxRmiConnectorNoClientCertificate.isActive()).isTrue();
        return null;
      }
    });
    return jmxConnectionHandler;
  }
  private boolean isReady(RmiConnector rmiConnector)
  {
    return rmiConnector.jmxRmiConnectorNoClientCertificate != null
        && rmiConnector.jmxRmiConnectorNoClientCertificate.isActive();
  }
  private JmxConnectionHandler getJmxConnectionHandler(List<ConnectionHandler> handlers)
  {
    for (ConnectionHandler<?> handler : handlers)