static void assertCorrectResponse(ConfigurationFactory configurationFactory, MfClientHttpRequestFactoryImpl requestFactory,
HttpCredential httpCredential, String expected, String target, String path) throws Exception {
final File configFile = AbstractMapfishSpringTest.getFile(HttpProxyTest.class, "proxy/config.yaml");
configurationFactory.setDoValidation(false);
final Configuration config = configurationFactory.getConfig(configFile);
final CertificateStore certificateStore = new CertificateStore();
certificateStore.setConfiguration(config);
certificateStore.setPassword("password");
certificateStore.setUri(getKeystoreFile().toURI());
config.setCertificateStore(certificateStore);
if (httpCredential instanceof HttpProxy) {
config.setProxies(Collections.singletonList((HttpProxy)httpCredential));
} else {
config.setCredentials(Collections.singletonList(httpCredential));
}
ConfigFileResolvingHttpRequestFactory clientHttpRequestFactory = new ConfigFileResolvingHttpRequestFactory(requestFactory,
config);