@Test public void should_use_base_uri() { RestAssuredCustomizer restAssuredCustomizer = new RestAssuredCustomizer(); Map<String, String> conf = new HashMap<>(); conf.put("baseUri", "http: final RestAssuredConfiguration restAssuredConfiguration = RestAssuredConfiguration.fromMap(conf); restAssuredCustomizer.configureRequestSpecBuilder(restAssuredConfiguration, cubeDockerConfiguration, requestSpecBuilder); verify(requestSpecBuilder).setBaseUri(("http: }
void configureRequestSpecBuilder(@Observes RestAssuredConfiguration restAssuredConfiguration, CubeDockerConfiguration cubeDockerConfiguration, RequestSpecBuilder requestSpecBuilder) { if (restAssuredConfiguration.isBaseUriSet()) { requestSpecBuilder.setBaseUri(restAssuredConfiguration.getBaseUri()); } else { requestSpecBuilder.setBaseUri( restAssuredConfiguration.getSchema() + ": } if (restAssuredConfiguration.isPortSet()) { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getPort(), restAssuredConfiguration.getExclusionContainers())); } else { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getExclusionContainers())); } if (restAssuredConfiguration.isBasePathSet()) { requestSpecBuilder.setBasePath(restAssuredConfiguration.getBasePath()); } if (restAssuredConfiguration.isAuthenticationSchemeSet()) { requestSpecBuilder.setAuth(restAssuredConfiguration.getAuthenticationScheme()); } if (restAssuredConfiguration.isUseRelaxedHttpsValidationSet()) { if (restAssuredConfiguration.isUseRelaxedHttpsValidationInAllProtocols()) { requestSpecBuilder.setRelaxedHTTPSValidation(); } else { requestSpecBuilder.setRelaxedHTTPSValidation(restAssuredConfiguration.getUseRelaxedHttpsValidation()); } } }
RestAssuredCustomizer { void configureRequestSpecBuilder(@Observes RestAssuredConfiguration restAssuredConfiguration, CubeDockerConfiguration cubeDockerConfiguration, RequestSpecBuilder requestSpecBuilder) { if (restAssuredConfiguration.isBaseUriSet()) { requestSpecBuilder.setBaseUri(restAssuredConfiguration.getBaseUri()); } else { requestSpecBuilder.setBaseUri( restAssuredConfiguration.getSchema() + ": } if (restAssuredConfiguration.isPortSet()) { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getPort(), restAssuredConfiguration.getExclusionContainers())); } else { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getExclusionContainers())); } if (restAssuredConfiguration.isBasePathSet()) { requestSpecBuilder.setBasePath(restAssuredConfiguration.getBasePath()); } if (restAssuredConfiguration.isAuthenticationSchemeSet()) { requestSpecBuilder.setAuth(restAssuredConfiguration.getAuthenticationScheme()); } if (restAssuredConfiguration.isUseRelaxedHttpsValidationSet()) { if (restAssuredConfiguration.isUseRelaxedHttpsValidationInAllProtocols()) { requestSpecBuilder.setRelaxedHTTPSValidation(); } else { requestSpecBuilder.setRelaxedHTTPSValidation(restAssuredConfiguration.getUseRelaxedHttpsValidation()); } } } }
RestAssuredCustomizer { void configureRequestSpecBuilder(@Observes RestAssuredConfiguration restAssuredConfiguration, CubeDockerConfiguration cubeDockerConfiguration, RequestSpecBuilder requestSpecBuilder) { if (restAssuredConfiguration.isBaseUriSet()) { requestSpecBuilder.setBaseUri(restAssuredConfiguration.getBaseUri()); } else { requestSpecBuilder.setBaseUri( restAssuredConfiguration.getSchema() + ": } if (restAssuredConfiguration.isPortSet()) { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getPort(), restAssuredConfiguration.getExclusionContainers())); } else { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getExclusionContainers())); } if (restAssuredConfiguration.isBasePathSet()) { requestSpecBuilder.setBasePath(restAssuredConfiguration.getBasePath()); } if (restAssuredConfiguration.isAuthenticationSchemeSet()) { requestSpecBuilder.setAuth(restAssuredConfiguration.getAuthenticationScheme()); } if (restAssuredConfiguration.isUseRelaxedHttpsValidationSet()) { if (restAssuredConfiguration.isUseRelaxedHttpsValidationInAllProtocols()) { requestSpecBuilder.setRelaxedHTTPSValidation(); } else { requestSpecBuilder.setRelaxedHTTPSValidation(restAssuredConfiguration.getUseRelaxedHttpsValidation()); } } }  }
RestAssuredCustomizer { void configureRequestSpecBuilder(@Observes RestAssuredConfiguration restAssuredConfiguration, CubeDockerConfiguration cubeDockerConfiguration, RequestSpecBuilder requestSpecBuilder) { if (restAssuredConfiguration.isBaseUriSet()) { requestSpecBuilder.setBaseUri(restAssuredConfiguration.getBaseUri()); } else { requestSpecBuilder.setBaseUri( restAssuredConfiguration.getSchema() + ": } if (restAssuredConfiguration.isPortSet()) { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getPort(), restAssuredConfiguration.getExclusionContainers())); } else { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getExclusionContainers())); } if (restAssuredConfiguration.isBasePathSet()) { requestSpecBuilder.setBasePath(restAssuredConfiguration.getBasePath()); } if (restAssuredConfiguration.isAuthenticationSchemeSet()) { requestSpecBuilder.setAuth(restAssuredConfiguration.getAuthenticationScheme()); } if (restAssuredConfiguration.isUseRelaxedHttpsValidationSet()) { if (restAssuredConfiguration.isUseRelaxedHttpsValidationInAllProtocols()) { requestSpecBuilder.setRelaxedHTTPSValidation(); } else { requestSpecBuilder.setRelaxedHTTPSValidation(restAssuredConfiguration.getUseRelaxedHttpsValidation()); } } }  void configure(@Observes RestAssuredConfiguration restAssuredConfiguration); void resetRestAssuredConfiguration(@Observes ManagerStopping event); }
RestAssuredCustomizer { void configureRequestSpecBuilder(@Observes RestAssuredConfiguration restAssuredConfiguration, CubeDockerConfiguration cubeDockerConfiguration, RequestSpecBuilder requestSpecBuilder) { if (restAssuredConfiguration.isBaseUriSet()) { requestSpecBuilder.setBaseUri(restAssuredConfiguration.getBaseUri()); } else { requestSpecBuilder.setBaseUri( restAssuredConfiguration.getSchema() + ": } if (restAssuredConfiguration.isPortSet()) { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getPort(), restAssuredConfiguration.getExclusionContainers())); } else { requestSpecBuilder.setPort(SinglePortBindResolver.resolveBindPort(cubeDockerConfiguration, restAssuredConfiguration.getExclusionContainers())); } if (restAssuredConfiguration.isBasePathSet()) { requestSpecBuilder.setBasePath(restAssuredConfiguration.getBasePath()); } if (restAssuredConfiguration.isAuthenticationSchemeSet()) { requestSpecBuilder.setAuth(restAssuredConfiguration.getAuthenticationScheme()); } if (restAssuredConfiguration.isUseRelaxedHttpsValidationSet()) { if (restAssuredConfiguration.isUseRelaxedHttpsValidationInAllProtocols()) { requestSpecBuilder.setRelaxedHTTPSValidation(); } else { requestSpecBuilder.setRelaxedHTTPSValidation(restAssuredConfiguration.getUseRelaxedHttpsValidation()); } } }  void configure(@Observes RestAssuredConfiguration restAssuredConfiguration); void resetRestAssuredConfiguration(@Observes ManagerStopping event);  }