use of com.dtflys.forest.config.ForestConfiguration in project forest by dromara.
the class TestForestConfiguration method testCustomized.
@Test
public void testCustomized() {
ForestConfiguration configuration = ForestConfiguration.createConfiguration();
configuration.setMaxRetryCount(3);
// configuration.setId("config_2");
// assertEquals("config_2", configuration.getId());
assertEquals(Integer.valueOf(3), configuration.getMaxRetryCount());
configuration.setMaxConnections(123);
assertEquals(Integer.valueOf(123), configuration.getMaxConnections());
configuration.setMaxRouteConnections(222);
assertEquals(Integer.valueOf(222), configuration.getMaxRouteConnections());
configuration.setTimeout(12000);
assertEquals(Integer.valueOf(12000), configuration.getTimeout());
configuration.setSslProtocol(SSLUtils.SSL_3);
configuration.setConnectTimeout(2000);
}
use of com.dtflys.forest.config.ForestConfiguration in project forest by dromara.
the class TestForestConfiguration method testConverterMap.
@Test
public void testConverterMap() {
ForestConfiguration configuration = ForestConfiguration.createConfiguration();
assertNotNull(configuration.getConverterMap());
Map<ForestDataType, ForestConverter> converterMap = new HashMap<>();
converterMap.put(ForestDataType.JSON, new ForestFastjsonConverter());
configuration.setConverterMap(converterMap);
assertEquals(converterMap, configuration.getConverterMap());
}
use of com.dtflys.forest.config.ForestConfiguration in project forest by dromara.
the class TestObjectConstructor method testRegisterObject.
@Test
public void testRegisterObject() {
ForestConfiguration configuration = ForestConfiguration.createConfiguration();
configuration.getForestObjectFactory().registerObject(SuccessWhen.class, new MySuccessWhen2());
SuccessWhen forestObject = configuration.getForestObject(SuccessWhen.class);
assertEquals(MySuccessWhen2.class, forestObject.getClass());
}
Aggregations