use of io.apiman.plugins.timeoutpolicy.beans.TimeoutConfigBean in project apiman-plugins by apiman.
the class TimeoutPolicyTest method shouldReturnConfigBeanWithValue_onParseConfiguration.
/**
* Control the parse system for the configuration
*/
@Test
@Configuration("{\"timeoutConnect\" : \"1\", \"timeoutRead\" : \"2\" }")
public void shouldReturnConfigBeanWithValue_onParseConfiguration() throws PolicyFailureError, Throwable {
Configuration config = this.getClass().getMethod("shouldReturnConfigBeanWithValue_onParseConfiguration").getAnnotation(Configuration.class);
// WHEN parse the configuration
TimeoutConfigBean policyConfigBean = timeoutPolicy.parseConfiguration(config.value());
// THEN the bean's value equals the test config
HashMap<?, ?> configMap = new ObjectMapper().readValue(config.value(), HashMap.class);
assertEquals(configMap.get("timeoutConnect"), policyConfigBean.getTimeoutConnect());
assertEquals(configMap.get("timeoutRead"), policyConfigBean.getTimeoutRead());
}
Aggregations