@Override protected void configure(ImposterConfig imposterConfig) throws Exception { super.configure(imposterConfig); }
@Before public void setUp(TestContext testContext) throws Exception { final Async async = testContext.async(); listenPort = findFreePort(); // simulate ImposterLauncher injector bootstrap final ImposterConfig imposterConfig = InjectorUtil.create(new BootstrapModule()).getInstance(ImposterConfig.class); configure(imposterConfig); rule.vertx().deployVerticle(ImposterVerticle.class.getCanonicalName(), completion -> { if (completion.succeeded()) { async.complete(); } else { testContext.fail(completion.cause()); } }); }
protected void configure(ImposterConfig imposterConfig) throws Exception { imposterConfig.setConfigDirs(new String[]{Paths.get(getClass().getResource("/config").toURI()).toString()}); imposterConfig.setPluginClassNames(new String[]{getPluginClass().getCanonicalName()}); imposterConfig.setHost(HOST); imposterConfig.setListenPort(listenPort); imposterConfig.setPluginArgs(emptyMap()); }
@Before public void setUp(TestContext testContext) throws Exception { super.setUp(testContext); // set up trust store for TLS System.setProperty("javax.net.ssl.trustStore", CryptoUtil.getDefaultKeystore(SfdcPluginImplTest.class).toString()); System.setProperty("javax.net.ssl.trustStorePassword", CryptoUtil.DEFAULT_KEYSTORE_PASSWORD); System.setProperty("javax.net.ssl.trustStoreType", "JKS"); // for localhost testing only javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier( (hostname, sslSession) -> hostname.equals("localhost")); }
@Before public void setUp(TestContext testContext) throws Exception { super.setUp(testContext); RestAssured.baseURI = "http://" + HOST + ":" + getListenPort(); }
@Before public void setUp(TestContext testContext) throws Exception { super.setUp(testContext); RestAssured.baseURI = "http://" + HOST + ":" + getListenPort(); }
@Override protected void configure(ImposterConfig imposterConfig) throws Exception { super.configure(imposterConfig); // enable TLS imposterConfig.setTlsEnabled(true); imposterConfig.setKeystorePath(CLASSPATH_PREFIX + DEFAULT_KEYSTORE_PATH); imposterConfig.setKeystorePassword(DEFAULT_KEYSTORE_PASSWORD); }
@Before public void setUp(TestContext testContext) throws Exception { super.setUp(testContext); // set up trust store for TLS RestAssured.trustStore(CryptoUtil.getDefaultKeystore(ImposterVerticleTest.class).toFile(), CryptoUtil.DEFAULT_KEYSTORE_PASSWORD); RestAssured.baseURI = "https://" + HOST + ":" + getListenPort(); }
@Override protected void configure(ImposterConfig imposterConfig) throws Exception { super.configure(imposterConfig); // enable TLS imposterConfig.setTlsEnabled(true); imposterConfig.setKeystorePath(CLASSPATH_PREFIX + DEFAULT_KEYSTORE_PATH); imposterConfig.setKeystorePassword(DEFAULT_KEYSTORE_PASSWORD); }