Search in sources :

Example 1 with MetaDataProviderBuilder

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();
    }
}
Also used : MetaDataProvider(com.ingenico.connect.gateway.sdk.java.MetaDataProvider) MetaDataProviderBuilder(com.ingenico.connect.gateway.sdk.java.MetaDataProviderBuilder) DirectoryParams(com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams) RequestHeader(com.ingenico.connect.gateway.sdk.java.RequestHeader) CommunicatorConfiguration(com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration) Client(com.ingenico.connect.gateway.sdk.java.Client) Session(com.ingenico.connect.gateway.sdk.java.Session) Directory(com.ingenico.connect.gateway.sdk.java.domain.product.Directory) Test(org.junit.Test)

Aggregations

Client (com.ingenico.connect.gateway.sdk.java.Client)1 CommunicatorConfiguration (com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration)1 MetaDataProvider (com.ingenico.connect.gateway.sdk.java.MetaDataProvider)1 MetaDataProviderBuilder (com.ingenico.connect.gateway.sdk.java.MetaDataProviderBuilder)1 RequestHeader (com.ingenico.connect.gateway.sdk.java.RequestHeader)1 Session (com.ingenico.connect.gateway.sdk.java.Session)1 Directory (com.ingenico.connect.gateway.sdk.java.domain.product.Directory)1 DirectoryParams (com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams)1 Test (org.junit.Test)1