components/src/test/java/eu/internetofus/common/components/AbstractComponentMocker.java
/**
   * Start the component mocker and wait until it is started.
   *
   * @param port to bind the mocker server or {@code 0} to find any available
   *             port.
   */
Start the component mocker and wait until it is started.
@param port to bind the mocker server or  0 to find any available
port.
Start the component mocker and wait until it is started . @param port to bind the mocker server or 0 to find any available port .
public void startServerAndWait(final int port) {
    final var semaphore = new Semaphore(0);
    new Thread(() -> {
      this.startServer(port).onComplete(handler -> semaphore.release());
    }).start();
    try {
      semaphore.acquire();
    } catch (final InterruptedException e) {
      InternalLogger.log(Level.ERROR, e);
    }
  }
public void startServerAndWait ( final int port ) { final var semaphore = new Semaphore ( 0 ) ; new Thread ( ( ) -> { this . startServer ( port ) . onComplete ( handler -> semaphore . release ( ) ) ; } ) . start ( ) ; try { semaphore . acquire ( ) ; } catch ( final InterruptedException e ) { InternalLogger . log ( Level . ERROR , e ) ; } }
Start the component mocker and wait until it is started.
Start the component mocker and wait until it is started .