vertx/src/test/java/eu/internetofus/common/vertx/ComponentClientWithCacheTest.java
/**
   * Verify that can get a cached head response.
   *
   * @param vertx       platform that manage the event bus.
   * @param client      to use.
   * @param testContext context that manage the test.
   */
Verify that can get a cached head response.
@param vertx       platform that manage the event bus.
@param client      to use.
@param testContext context that manage the test.
Verify that can get a cached head response . @param vertx platform that manage the event bus . @param client to use . @param testContext context that manage the test .
@Test
  public void shouldHeadWithCache(final Vertx vertx, final WebClient client, final VertxTestContext testContext) {
    final var defaultUrl = "http://localhost:1234/api";
    final var service = new ComponentClientWithCache(client, new JsonObject(), "api", defaultUrl);
    service.cache.put("head:" + defaultUrl + "/1", "true");
    service.headWithCache("1").onComplete(testContext.succeeding(content -> testContext.verify(() -> {
      assertThat(content).isTrue();
      testContext.completeNow();
    })));
  }
@ Test public void shouldHeadWithCache ( final Vertx vertx , final WebClient client , final VertxTestContext testContext ) { final var defaultUrl = "http://localhost:1234/api" ; final var service = new ComponentClientWithCache ( client , new JsonObject ( ) , "api" , defaultUrl ) ; service . cache . put ( "head:" + defaultUrl + "/1" , "true" ) ; service . headWithCache ( "1" ) . onComplete ( testContext . succeeding ( content -> testContext . verify ( ( ) -> { assertThat ( content ) . isTrue ( ) ; testContext . completeNow ( ) ; } ) ) ) ; }
Verify that can get a cached head response.
Verify that can get a cached head response .