use of com.ingenico.connect.gateway.sdk.java.MetaDataProviderBuilder in project connect-sdk-java by Ingenico-ePayments.
the class MultiLineHeaderTest method test.
/**
* Smoke test for products service.
*/
@Test
public void test() throws URISyntaxException, IOException {
CommunicatorConfiguration configuration = getCommunicatorConfiguration();
String multiLineHeader = " some value \r\n \n with some \r\n spaces ";
MetaDataProvider metaDataProvider = new MetaDataProviderBuilder("Ingenico").withAdditionalRequestHeader(new RequestHeader("X-GCS-MultiLineHeader", multiLineHeader)).build();
DirectoryParams params = new DirectoryParams();
params.setCountryCode("NL");
params.setCurrencyCode("EUR");
Session session = Factory.createSessionBuilder(configuration).withMetaDataProvider(metaDataProvider).build();
Client client = Factory.createClient(session);
try {
Directory response = client.merchant("8500").products().directory(809, params);
Assert.assertTrue(response.getEntries().size() > 0);
} finally {
client.close();
}
}
Aggregations