use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoSourceOrSinkTestIT method testGetClientService.
@Test(expected = IOException.class)
public void testGetClientService() throws Exception {
TMarketoInputProperties props = new TMarketoInputProperties("test");
props.setupProperties();
props.connection.setupProperties();
sos.initialize(null, props);
assertEquals("Marketo REST API Client [].", sos.getClientService(null).toString());
// 2times for cache
assertEquals("Marketo REST API Client [].", sos.getClientService(null).toString());
props.setupProperties();
sos = new MarketoSourceOrSink();
props.connection.apiMode.setValue(APIMode.SOAP);
props.connection.endpoint.setValue("https://www.marketo.com");
sos.initialize(null, props);
assertEquals("Marketo SOAP API Client [null].", sos.getClientService(null).toString());
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoSourceTest method testTDI38561.
@Test
public void testTDI38561() throws Exception {
TMarketoInputProperties props = new TMarketoInputProperties("test");
props.connection.setupProperties();
props.setupProperties();
props.connection.endpoint.setValue("htp:ttoot.com");
props.connection.clientAccessId.setValue("user");
props.connection.secretKey.setValue("secret");
source.initialize(null, props);
assertEquals(ValidationResult.Result.ERROR, source.validate(null).getStatus());
props.connection.endpoint.setValue("https://ttoot.com");
source.initialize(null, props);
assertEquals(ValidationResult.Result.ERROR, source.validate(null).getStatus());
props.connection.endpoint.setValue("https://ttoot.com/rustinpeace/rest");
source.initialize(null, props);
assertEquals(ValidationResult.Result.ERROR, source.validate(null).getStatus());
props.connection.endpoint.setValue("https://ttoot.com/rest");
source.initialize(null, props);
ValidationResult vr = source.validate(null);
assertEquals(ValidationResult.Result.ERROR, vr.getStatus());
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoSourceTest method setUp.
@Before
public void setUp() throws Exception {
source = new MarketoSource();
//
iprops = new TMarketoInputProperties("test");
iprops.connection.setupProperties();
iprops.connection.endpoint.setValue("http://ABC.mkto.com");
iprops.connection.clientAccessId.setValue("fakeId");
iprops.connection.secretKey.setValue("sekret");
iprops.setupProperties();
//
bulkProps = new TMarketoBulkExecProperties("test");
bulkProps.setupProperties();
bulkProps.connection.init();
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoLeadClientTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
iprops = new TMarketoInputProperties("test");
iprops.schemaInput.setupProperties();
iprops.schemaInput.setupLayout();
iprops.connection.setupProperties();
iprops.connection.setupLayout();
iprops.connection.setupProperties();
iprops.connection.endpoint.setValue("https://fake.io/rest");
iprops.connection.clientAccessId.setValue("clientaccess");
iprops.connection.secretKey.setValue("sekret");
// shorten interval for tests
iprops.connection.attemptsIntervalTime.setValue(200);
iprops.setupProperties();
iprops.setupLayout();
oprops = new TMarketoOutputProperties("test");
oprops.schemaInput.setupProperties();
oprops.schemaInput.setupLayout();
oprops.connection.setupProperties();
oprops.connection.setupLayout();
oprops.connection.setupProperties();
oprops.connection.endpoint.setValue("https://fake.io/rest");
oprops.connection.clientAccessId.setValue("clientaccess");
oprops.connection.secretKey.setValue("sekret");
// shorten interval for tests
oprops.connection.attemptsIntervalTime.setValue(200);
oprops.setupProperties();
oprops.setupLayout();
lprops = new TMarketoListOperationProperties("test");
lprops.schemaInput.setupProperties();
lprops.schemaInput.setupLayout();
lprops.connection.setupProperties();
lprops.connection.setupLayout();
lprops.connection.setupProperties();
lprops.connection.endpoint.setValue("https://fake.io/rest");
lprops.connection.clientAccessId.setValue("clientaccess");
lprops.connection.secretKey.setValue("sekret");
// shorten interval for tests
lprops.connection.attemptsIntervalTime.setValue(200);
lprops.setupProperties();
lprops.setupLayout();
client = spy(new MarketoRESTClient(iprops.connection));
doNothing().when(client).getToken();
doReturn("000123456").when(client).getPageToken(anyString());
client.connect();
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoSOAPClientTest method setUp.
@Before
public void setUp() throws Exception {
iprops = new TMarketoInputProperties("test");
iprops.schemaInput.setupProperties();
iprops.schemaInput.setupLayout();
iprops.connection.setupProperties();
iprops.connection.setupLayout();
iprops.connection.setupProperties();
iprops.connection.apiMode.setValue(APIMode.SOAP);
iprops.connection.endpoint.setValue("https://fake.io");
iprops.connection.clientAccessId.setValue("clientaccess");
iprops.connection.secretKey.setValue("sekret");
iprops.setupProperties();
iprops.setupLayout();
oprops = new TMarketoOutputProperties("test");
oprops.schemaInput.setupProperties();
oprops.schemaInput.setupLayout();
oprops.connection.setupProperties();
oprops.connection.setupLayout();
oprops.connection.setupProperties();
oprops.connection.apiMode.setValue(APIMode.SOAP);
oprops.connection.endpoint.setValue("https://fake.io");
oprops.connection.clientAccessId.setValue("clientaccess");
oprops.connection.secretKey.setValue("sekret");
oprops.setupProperties();
oprops.setupLayout();
lprops = new TMarketoListOperationProperties("test");
lprops.schemaInput.setupProperties();
lprops.schemaInput.setupLayout();
lprops.connection.setupProperties();
lprops.connection.setupLayout();
lprops.connection.setupProperties();
lprops.connection.apiMode.setValue(APIMode.SOAP);
lprops.connection.endpoint.setValue("https://fake.io");
lprops.connection.clientAccessId.setValue("clientaccess");
lprops.connection.secretKey.setValue("sekret");
lprops.setupProperties();
lprops.setupLayout();
client = spy(new MarketoSOAPClient(iprops.connection));
port = mock(MktowsPort.class);
AuthenticationHeader header = mock(AuthenticationHeader.class);
doReturn(port).when(client).getMktowsApiSoapPort();
doReturn(header).when(client).getAuthentificationHeader();
doReturn(null).when(port).listMObjects(any(ParamsListMObjects.class), any(AuthenticationHeader.class));
client.connect();
objectFactory = new ObjectFactory();
factory = DatatypeFactory.newInstance();
Date dateTest = MarketoUtils.parseDateString(DATE_EXPECTED);
gcDateTest = new GregorianCalendar();
gcDateTest.setTime(dateTest);
}
Aggregations