@@ -0,0 +1,2505 @@
+%0Aimport io.vertx.core.DeploymentOptions;%0Aimport io.vertx.core.Vertx;%0Aimport io.vertx.core.logging.Logger;%0Aimport io.vertx.core.logging.LoggerFactory;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport io.vertx.ext.unit.Async;%0Aimport io.vertx.ext.unit.TestContext;%0Aimport io.vertx.ext.unit.junit.VertxUnitRunner;%0Aimport java.util.HashMap;%0Aimport org.folio.okapi.common.OkapiClient;%0Aimport org.folio.okapi.header.MainVerticle;%0A%0A%0A@java.lang.SuppressWarnings(%7B%22squid:S1192%22%7D)%0A@RunWith(VertxUnitRunner.class)%0Apublic class HeaderModuleTest %7B%0A%0A  private Vertx vertx;%0A  private static final int PORT = 9130;%0A  private static final String URL = %22http://localhost:%22 + Integer.toString(PORT);%0A  private final Logger logger = LoggerFactory.getLogger(%22okapi%22);%0A%0A  public HeaderModuleTest() %7B%0A  %7D%0A%0A  @Before%0A  public void setUp(TestContext context) %7B%0A    logger.debug(%22setUp%22);%0A    vertx = Vertx.vertx();%0A%0A    System.setProperty(%22port%22, Integer.toString(PORT));%0A%0A    DeploymentOptions opt = new DeploymentOptions();%0A    vertx.deployVerticle(MainVerticle.class.getName(), opt, context.asyncAssertSuccess());%0A  %7D%0A%0A  @After%0A  public void tearDown(TestContext context) %7B%0A    Async async = context.async();%0A    vertx.close(x -%3E async.complete());%0A  %7D%0A%0A  @Test%0A  public void test1(TestContext context) %7B%0A    Async async = context.async();%0A%0A    HashMap%3CString, String%3E headers = new HashMap%3C%3E();%0A%0A    OkapiClient cli = new OkapiClient(URL, vertx, headers);%0A    cli.get(%22/testb%22, res -%3E %7B%0A      context.assertTrue(res.succeeded());%0A      context.assertEquals(%22foo%22, cli.getRespHeaders().get(%22X-my-header%22));%0A      test2(context, async);%0A    %7D);%0A  %7D%0A%0A  private void test2(TestContext context, Async async) %7B%0A%0A    HashMap%3CString, String%3E headers = new HashMap%3C%3E();%0A    headers.put(%22X-my-header%22, %22hello%22);%0A    OkapiClient cli = new OkapiClient(URL, vertx, headers);%0A    cli.get(%22/testb%22, res -%3E %7B%0A      context.assertTrue(res.succeeded());%0A      context.assertEquals(%22hello,foo%22, cli.getRespHeaders().get(%22X-my-header%22));%0A      test3(context, async);%0A    %7D);%0A%0A  %7D%0A%0A  public void test3(TestContext context, Async async) %7B%0A%0A    HashMap%3CString, String%3E headers = new HashMap%3C%3E();%0A%0A    OkapiClient cli = new OkapiClient(URL, vertx, headers);%0A    cli.post(%22/_/tenantPermissions%22, %22a, b,%5Cnc%22, res -%3E %7B%0A      context.assertTrue(res.succeeded());%0A      context.assertEquals(%22a, b, c%22, cli.getRespHeaders().get(%22X-Tenant-Perms-Result%22));%0A      async.complete();%0A    %7D);%0A  %7D%0A%0A%7D%0A

Test header module