vertx/src/test/java/eu/internetofus/common/vertx/ComponentClientTest.java
/**
   * Test the creation of an absolute URL
   *
   * @param componentURL url to the component.
   * @param values       paths to set it are separated by :.
   * @param expectedURL  the URL that has to create the client.
   * @param vertx        event bus to use.
   * @param client       to use.
   * @param testContext  context that manage the test.
   */
Test the creation of an absolute URL
@param componentURL url to the component.
@param values       paths to set it are separated by :.
@param expectedURL  the URL that has to create the client.
@param vertx        event bus to use.
@param client       to use.
@param testContext  context that manage the test.
Test the creation of an absolute URL @param componentURL url to the component . @param values paths to set it are separated by : . @param expectedURL the URL that has to create the client . @param vertx event bus to use . @param client to use . @param testContext context that manage the test .
@ParameterizedTest(name = "Should the absolute URL for component {0} with parameters {1} be equals to {2}")
  @CsvSource({ "https://localhost:8080,,https://localhost:8080",
      "https://localhost:8080,a:b:c,https://localhost:8080/a/b/c",
      "https://localhost:8080,a:b:c,https://localhost:8080/a/b/c",
      "https://localhost:8080/,/a/:/b:c/,https://localhost:8080/a/b/c/",
      "https://localhost:8080/,/a/:b/:/c,https://localhost:8080/a/b/c",
      "https://localhost:8080/,a/:/b/:/c,https://localhost:8080/a/b/c",
      "https://localhost:8080/,a/b:/c,https://localhost:8080/a/b/c",
      "https://localhost:8080/,/a/b/:/c,https://localhost:8080/a/b/c",
      "https://localhost:8080/,a/:/b/c:d,https://localhost:8080/a/b/c/d",
      "https://localhost:8080/,/a/:b / d /:/c,https://localhost:8080/a/b%20/%20d%20/c",
      "https://localhost:8080,/a/b/c/,https://localhost:8080/a/b/c/",
      "https://localhost:8080/,/a/b/c/,https://localhost:8080/a/b/c/" })
  public void shouldCreateAbsoluteUrlWith(final String componentURL, final String values, final String expectedURL,
      final Vertx vertx, final WebClient client, final VertxTestContext testContext) {
    final var componentClient = new ComponentClient(client, componentURL);
    var paths = new Object[0];
    if (values != null) {
      paths = values.split(":");
    }
    assertThat(componentClient.createAbsoluteUrlWith(paths)).isEqualTo(expectedURL);
    testContext.completeNow();
  }
@ ParameterizedTest ( name = "Should the absolute URL for component {0} with parameters {1} be equals to {2}" ) @ CsvSource ( { "https://localhost:8080,,https://localhost:8080" , "https://localhost:8080,a:b:c,https://localhost:8080/a/b/c" , "https://localhost:8080,a:b:c,https://localhost:8080/a/b/c" , "https://localhost:8080/,/a/:/b:c/,https://localhost:8080/a/b/c/" , "https://localhost:8080/,/a/:b/:/c,https://localhost:8080/a/b/c" , "https://localhost:8080/,a/:/b/:/c,https://localhost:8080/a/b/c" , "https://localhost:8080/,a/b:/c,https://localhost:8080/a/b/c" , "https://localhost:8080/,/a/b/:/c,https://localhost:8080/a/b/c" , "https://localhost:8080/,a/:/b/c:d,https://localhost:8080/a/b/c/d" , "https://localhost:8080/,/a/:b / d /:/c,https://localhost:8080/a/b%20/%20d%20/c" , "https://localhost:8080,/a/b/c/,https://localhost:8080/a/b/c/" , "https://localhost:8080/,/a/b/c/,https://localhost:8080/a/b/c/" } ) public void shouldCreateAbsoluteUrlWith ( final String componentURL , final String values , final String expectedURL , final Vertx vertx , final WebClient client , final VertxTestContext testContext ) { final var componentClient = new ComponentClient ( client , componentURL ) ; var paths = new Object [ 0 ] ; if ( values != null ) { paths = values . split ( ":" ) ; } assertThat ( componentClient . createAbsoluteUrlWith ( paths ) ) . isEqualTo ( expectedURL ) ; testContext . completeNow ( ) ; }
Test the creation of an absolute URL
 @param componentURL url to the component.
Test the creation of an absolute URL @param componentURL url to the component .