Created
March 22, 2012 17:33
-
-
Save jenglert/2160489 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected RedirectManager createRedirectManager(final boolean captureOutput) { | |
final String productServiceUrl = "http://localhost:7501/product_service/1.0"; | |
final String captureDir = "./src/test/resources/json/" + getClass().getSimpleName() + "/product_service"; | |
Sales salesClient = SalesFactory.instance(new MapConfig(new HashMap<String, Object>() {{ | |
if (captureOutput) { | |
put(SalesFactory.PRODUCT_SERVICE_URI(), productServiceUrl); | |
put(SalesFactory.CAPTURE_DIR(), captureDir); | |
} | |
else { | |
put(SalesFactory.PRODUCT_SERVICE_URI(), "file:" + captureDir); | |
} | |
put("client_params", new HashMap<String, Object>() {{ put("request_timeout_ms", 120000); }}); | |
}})); | |
ProductLooks productLooksClient = ProductLooksFactory.instance(new MapConfig(new HashMap<String, Object>() {{ | |
if (captureOutput) { | |
put(SalesFactory.PRODUCT_SERVICE_URI(), productServiceUrl); | |
put(SalesFactory.CAPTURE_DIR(), captureDir); | |
} | |
else { | |
put(SalesFactory.PRODUCT_SERVICE_URI(), "file:" + captureDir); | |
} | |
put("client_params", new HashMap<String, Object>() {{ put("request_timeout_ms", 120000); }}); | |
}})); | |
try { | |
return new RedirectManager(salesClient, productLooksClient); | |
} catch (Exception e) { | |
throw new RuntimeException(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment