use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoSOAPClientTestIT method testGetMultipleLeadsListNameFail.
@Test
public void testGetMultipleLeadsListNameFail() throws Exception {
inputProperties.inputOperation.setValue(getMultipleLeads);
inputProperties.leadSelectorSOAP.setValue(StaticListSelector);
inputProperties.updateSchemaRelated();
inputProperties.batchSize.setValue(200);
//
inputProperties.listParam.setValue(STATIC_LIST_NAME);
inputProperties.listParamListName.setValue("undx_test_list******");
MarketoSource source = new MarketoSource();
source.initialize(null, inputProperties);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getMultipleLeads(inputProperties, null);
LOG.debug("{}", result);
assertTrue(result.isSuccess());
assertNotNull(result.getErrors());
assertEquals(0, result.getRecordCount());
assertEquals(0, result.getRemainCount());
assertEquals(emptyList(), client.getMultipleLeads(inputProperties, null).getRecords());
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoSOAPClientTestIT method testGetLeadsChangesExcludeFilter.
@Test
public void testGetLeadsChangesExcludeFilter() throws Exception {
inputProperties.inputOperation.setValue(getLeadChanges);
inputProperties.updateSchemaRelated();
inputProperties.batchSize.setValue(1000);
//
inputProperties.oldestCreateDate.setValue(DATE_OLDEST_CREATE);
inputProperties.latestCreateDate.setValue(DATE_LATEST_CREATE);
inputProperties.setExcludeTypes.setValue(true);
inputProperties.excludeTypes.type.getValue().add(NewLead.toString());
inputProperties.excludeTypes.type.getValue().add(ChangeDataValue.toString());
MarketoSource source = new MarketoSource();
source.initialize(null, inputProperties);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getLeadChanges(inputProperties, null);
List<IndexedRecord> changes = result.getRecords();
assertTrue(changes.size() > 0);
for (IndexedRecord r : changes) {
assertTrue(!"New Lead".equals(r.get(2)) && !"Change Data Value".equals(r.get(2)));
}
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoSOAPClientTestIT method testGetMultipleLeadsListName.
@Test
public void testGetMultipleLeadsListName() throws Exception {
inputProperties.inputOperation.setValue(getMultipleLeads);
inputProperties.leadSelectorSOAP.setValue(StaticListSelector);
inputProperties.updateSchemaRelated();
inputProperties.batchSize.setValue(4);
inputProperties.listParam.setValue(STATIC_LIST_NAME);
inputProperties.listParamListName.setValue(UNDX_TEST_LIST_SMALL);
MarketoSource source = new MarketoSource();
source.initialize(null, inputProperties);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getMultipleLeads(inputProperties, null);
LOG.debug("{}", result);
assertTrue(result.isSuccess());
assertTrue(result.getRecordCount() > 3);
assertTrue(result.getRemainCount() > 0);
assertNotNull(result.getStreamPosition());
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoSOAPClientTestIT method testGetLeadsChangesPagination.
@Test
public void testGetLeadsChangesPagination() throws Exception {
inputProperties.inputOperation.setValue(getLeadChanges);
inputProperties.updateSchemaRelated();
inputProperties.batchSize.setValue(100);
//
inputProperties.oldestCreateDate.setValue(DATE_OLDEST_CREATE);
inputProperties.latestCreateDate.setValue(DATE_LATEST_CREATE);
MarketoSource source = new MarketoSource();
source.initialize(null, inputProperties);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = null;
List<IndexedRecord> changes = null;
int totalRecords = 0;
int counted = 0;
result = client.getLeadChanges(inputProperties, null);
totalRecords = result.getRecordCount() + result.getRemainCount();
counted = result.getRecordCount();
while (result.getRemainCount() > 0) {
result = client.getLeadChanges(inputProperties, result.getStreamPosition());
counted += result.getRecordCount();
changes = result.getRecords();
assertTrue(changes.size() > 0);
}
assertTrue(inputProperties.batchSize.getValue() < counted);
}
use of org.talend.components.marketo.runtime.MarketoSource in project components by Talend.
the class MarketoSOAPClientTestIT method testGetLeadActivityPagination.
@Test
public void testGetLeadActivityPagination() throws Exception {
inputProperties.inputOperation.setValue(getLeadActivity);
inputProperties.leadKeyTypeSOAP.setValue(EMAIL);
inputProperties.leadSelectorSOAP.setValue(LeadKeySelector);
inputProperties.updateSchemaRelated();
inputProperties.batchSize.setValue(3);
//
inputProperties.leadKeyValue.setValue(EMAIL_LEAD_MANY_INFOS);
MarketoSource source = new MarketoSource();
source.initialize(null, inputProperties);
MarketoClientService client = source.getClientService(null);
//
MarketoRecordResult result = client.getLeadActivity(inputProperties, null);
int totalRecords = result.getRecordCount() + result.getRemainCount();
int counted = result.getRecordCount();
while (result.getRemainCount() > 0) {
result = client.getLeadActivity(inputProperties, result.getStreamPosition());
counted += result.getRecordCount();
}
assertEquals(totalRecords, counted);
}
Aggregations