use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoRESTClientTestIT method testGetLeadFail.
@Test
public void testGetLeadFail() throws Exception {
iprops.inputOperation.setValue(getLead);
iprops.leadKeyTypeREST.setValue(email);
iprops.afterInputOperation();
//
iprops.leadKeyValue.setValue(EMAIL_INEXISTANT);
MarketoSource source = new MarketoSource();
source.initialize(null, iprops);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getLead(iprops, null);
LOG.debug("{}", result);
List<IndexedRecord> records = result.getRecords();
assertEquals(emptyList(), records);
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoRESTClientTestIT method testGetMultipleLeadsListNameFail.
@Test
public void testGetMultipleLeadsListNameFail() throws Exception {
iprops.inputOperation.setValue(getMultipleLeads);
iprops.afterInputOperation();
iprops.batchSize.setValue(200);
//
iprops.leadSelectorREST.setValue(StaticListSelector);
iprops.listParam.setValue(STATIC_LIST_NAME);
iprops.listParamListName.setValue("undx_test_list******");
MarketoSource source = new MarketoSource();
source.initialize(null, iprops);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getMultipleLeads(iprops, null);
LOG.debug("{}", result);
assertFalse(result.isSuccess());
assertNotNull(result.getErrors());
assertEquals(0, result.getRecordCount());
assertEquals(0, result.getRemainCount());
assertEquals(emptyList(), client.getMultipleLeads(iprops, null).getRecords());
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoRESTClientTestIT method testGetLeadActivityIncludeFilter.
@Test
public void testGetLeadActivityIncludeFilter() throws Exception {
iprops.inputOperation.setValue(getLeadActivity);
iprops.afterInputOperation();
iprops.batchSize.setValue(300);
iprops.includeTypes.type.getValue().add(IncludeExcludeFieldsREST.NewLead.toString());
iprops.includeTypes.type.getValue().add(IncludeExcludeFieldsREST.ChangeDataValue.toString());
iprops.sinceDateTime.setValue(DATE_OLDEST_CREATE);
iprops.beforeMappingInput();
//
MarketoSource source = new MarketoSource();
source.initialize(null, iprops);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getLeadActivity(iprops, null);
LOG.debug("{}", result);
List<IndexedRecord> activities = result.getRecords();
assertTrue(activities.size() > 0);
for (IndexedRecord r : activities) {
LOG.debug("r=" + r);
assertTrue("New Lead".equals(r.get(4)) || "Change Data Value".equals(r.get(4)));
}
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoRESTClientTestIT method testGetLeadsChanges.
/*
*
* ************************ getLeadChanges ************************
*
*/
@Test
public void testGetLeadsChanges() throws Exception {
iprops.inputOperation.setValue(getLeadChanges);
iprops.afterInputOperation();
iprops.batchSize.setValue(100);
iprops.sinceDateTime.setValue(DATE_OLDEST_CREATE);
iprops.fieldList.setValue("id,email,firstName,lastName,company");
iprops.beforeMappingInput();
//
MarketoSource source = new MarketoSource();
source.initialize(null, iprops);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getLeadChanges(iprops, null);
LOG.debug("{}", result);
List<IndexedRecord> changes = result.getRecords();
assertTrue(changes.size() > 0);
assertTrue(result.getRemainCount() > 0);
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoRESTClientTestIT method testBadConnectionString.
@Test(expected = IOException.class)
public void testBadConnectionString() throws Exception {
iprops.connection.endpoint.setValue("htps://marketo.com/rest/v1");
MarketoSource source = new MarketoSource();
source.initialize(null, iprops);
MarketoClientService client = source.getClientService(null);
fail("Shouldn't be here");
}
Aggregations