testMessage.assertIsSatisfied();
}
private void setupExchange(Exchange exchange, ProvisionAuthentication auth){
Api api = new Api();
ApiContext env = new ApiContext();
env.setId("test");
api.setType(ApiType.PASS_THROUGH);
api.setContexts(Arrays.asList(env));
List<TargetHost> targetList = new ArrayList<TargetHost>();
api.setEndpoint("www.yahoo.fr");
TargetHost to1 = new TargetHost();
to1.setUrl("http://www.google.com");
targetList.add(to1);
TargetHost to2 = new TargetHost();
to2.setUrl("http://www.google.com?toto=tutu");
targetList.add(to2);
TargetHost to3 = new TargetHost();
to3.setUrl("http://www.google.com?toto=tutu&tata=tete&titi=toto");
targetList.add(to3);
env.setTargetHosts(targetList);
TdrEnabled tdr = new TdrEnabled();
tdr.setEnabled("true");
api.setTdrEnabled(tdr);
api.setAuthentication(auth);
TdrData tdrData = new TdrData();
TdrType tdrType = new TdrType();
tdrType.getType().add("apiRateLimit");
DynamicTdr dt = new DynamicTdr();
dt.setHttpHeaderName("HTTP_HEADER");
dt.setTdrPropName("propname");
dt.setTypes(tdrType);
tdrData.getDynamic().add(dt);
StaticTdr st = new StaticTdr();
st.setValue("staticValue");
st.setTdrPropName("staticName");
st.setTypes(tdrType);
tdrData.getStatic().add(st);
api.setTdr(tdrData);
HTTPSType httpsType = new HTTPSType();
httpsType.setEnabled(true);
httpsType.setTlsMode(TLSMode.ONE_WAY);
api.setHttps(httpsType);
exchange.setProperty(ExchangeConstantKeys.E3_REQUEST_PAYLOAD.toString(), api);
exchange.setProperty(ExchangeConstantKeys.E3_API_ID.toString(), "MyApiID");
exchange.setProperty(ExchangeConstantKeys.E3_API_ID_ENCODED.toString(), "MonApiIDEncoded");
exchange.setProperty(ExchangeConstantKeys.E3_PROVISION_ID.toString(), "MyProvId");