use of com.dtflys.spring.test.client0.BeastshopClient in project forest by dromara.
the class SSLTest method testSSL.
public void testSSL() {
applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:ssl-test.xml" });
ForestConfiguration configuration = (ForestConfiguration) applicationContext.getBean("forestConfiguration");
SSLKeyStore keyStore = configuration.getKeyStore("keystore1");
assertNotNull(keyStore);
assertNotNull(keyStore.getInputStream());
assertEquals("keystore1", keyStore.getId());
assertEquals("123456", keyStore.getKeystorePass());
assertEquals("jks", keyStore.getKeystoreType());
assertThat(keyStore.getSslSocketFactoryBuilder()).isNotNull().isInstanceOf(MySSLSocketFactoryBuilder.class);
assertThat(keyStore.getHostnameVerifier()).isNotNull().isInstanceOf(MyHostnameVerifier.class);
BeastshopClient beastshopClient = (BeastshopClient) applicationContext.getBean("beastshopClient");
assertNotNull(beastshopClient);
String result = beastshopClient.index();
assertNotNull(result);
Throwable th = null;
try {
beastshopClient.index2();
} catch (ForestRuntimeException ex) {
th = ex.getCause();
}
assertThat(th).isNotNull();
}
use of com.dtflys.spring.test.client0.BeastshopClient in project forest by dromara.
the class ClientTest method testScan.
public void testScan() {
applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:client-test.xml" });
BeastshopClient beastshopClient = (BeastshopClient) applicationContext.getBean("beastshopClient");
assertNotNull(beastshopClient);
String result = beastshopClient.index();
assertNotNull(result);
Object baseUrl = Forest.config().getVariableValue("baseUrl");
assertThat(baseUrl).isNotNull().isEqualTo("http://www.thebeastshop.com");
}
use of com.dtflys.spring.test.client0.BeastshopClient in project forest by dromara.
the class ScanTest method testScan.
public void testScan() {
applicationContext = new ClassPathXmlApplicationContext(new String[] { "classpath:scan-test.xml" });
BeastshopClient beastshopClient = (BeastshopClient) applicationContext.getBean("beastshopClient");
assertNotNull(beastshopClient);
}
Aggregations