use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoInputReaderTestIT method testLeadActivityExcludeREST.
@Test
public void testLeadActivityExcludeREST() throws Exception {
TMarketoInputProperties props = getRESTProperties();
props.inputOperation.setValue(getLeadActivity);
String since = new SimpleDateFormat(DATETIME_PATTERN_PARAM).format(new Date(new Date().getTime() - 10000000));
props.sinceDateTime.setValue(since);
props.batchSize.setValue(300);
props.afterInputOperation();
props.beforeMappingInput();
props.setExcludeTypes.setValue(true);
props.excludeTypes.type.setValue(Arrays.asList("NewLead", "ChangeDataValue"));
reader = getReader(props);
assertTrue(reader.start());
IndexedRecord r = reader.getCurrent();
assertNotNull(r);
assertTrue(r.getSchema().getFields().size() > 6);
while (reader.advance()) {
r = reader.getCurrent();
assertNotNull(r);
// activityTypeId != NewLead
assertNotEquals(12, r.get(3));
// activityTypeId != ChangeDataValue
assertNotEquals(13, r.get(3));
}
assertTrue(((int) reader.getReturnValues().get(RETURN_NB_CALL)) >= 6);
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoInputReaderTestIT method testLeadChanges.
@Test
public void testLeadChanges() throws Exception {
TMarketoInputProperties props = getSOAPProperties();
props.inputOperation.setValue(getLeadChanges);
props.afterInputOperation();
props.batchSize.setValue(50);
//
props.oldestCreateDate.setValue(DATE_OLDEST_CREATE);
props.latestCreateDate.setValue(DATE_LATEST_CREATE);
reader = getReader(props);
assertTrue(reader.start());
LOG.debug("record = {}.", reader.getCurrent());
assertTrue(reader.advance());
LOG.debug("record = {}.", reader.getCurrent());
while (reader.advance()) {
assertNotNull(reader.getCurrent());
// LOG.debug("email: {}", reader.getCurrent().get(1));
}
assertTrue(((int) reader.getReturnValues().get(RETURN_NB_CALL)) > 1);
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoClientCustomObjectsTestIT method setUp.
@Before
public void setUp() throws Exception {
irProps = new TMarketoInputProperties("test");
irProps.connection.setupProperties();
irProps.connection.endpoint.setValue(ENDPOINT_REST);
irProps.connection.clientAccessId.setValue(USERID_REST);
irProps.connection.secretKey.setValue(SECRETKEY_REST);
irProps.connection.apiMode.setValue(REST);
irProps.schemaInput.setupProperties();
irProps.mappingInput.setupProperties();
irProps.setupProperties();
irProps.includeTypes.setupProperties();
irProps.includeTypes.type.setValue(new ArrayList<String>());
irProps.excludeTypes.setupProperties();
irProps.excludeTypes.type.setValue(new ArrayList<String>());
irProps.connection.setupLayout();
irProps.schemaInput.setupLayout();
irProps.setupLayout();
//
oprops = new TMarketoOutputProperties("test");
oprops.connection.setupProperties();
oprops.connection.apiMode.setValue(REST);
oprops.connection.endpoint.setValue(ENDPOINT_REST);
oprops.connection.clientAccessId.setValue(USERID_REST);
oprops.connection.secretKey.setValue(SECRETKEY_REST);
oprops.schemaInput.setupProperties();
oprops.setupProperties();
oprops.connection.setupLayout();
oprops.schemaInput.setupLayout();
oprops.setupLayout();
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoRESTClientTestIT method setUp.
@Before
public void setUp() throws Exception {
iprops = new TMarketoInputProperties("test");
iprops.connection.setupProperties();
iprops.connection.endpoint.setValue(ENDPOINT_REST);
iprops.connection.clientAccessId.setValue(USERID_REST);
iprops.connection.secretKey.setValue(SECRETKEY_REST);
iprops.connection.apiMode.setValue(APIMode.REST);
iprops.schemaInput.setupProperties();
iprops.mappingInput.setupProperties();
iprops.setupProperties();
iprops.includeTypes.setupProperties();
iprops.includeTypes.type.setValue(new ArrayList<String>());
iprops.excludeTypes.setupProperties();
iprops.excludeTypes.type.setValue(new ArrayList<String>());
iprops.connection.setupLayout();
iprops.schemaInput.setupLayout();
iprops.setupLayout();
//
listProperties = new TMarketoListOperationProperties("test");
listProperties.connection.setupProperties();
listProperties.connection.endpoint.setValue(ENDPOINT_REST);
listProperties.connection.clientAccessId.setValue(USERID_REST);
listProperties.connection.secretKey.setValue(SECRETKEY_REST);
listProperties.connection.apiMode.setValue(APIMode.REST);
listProperties.schemaInput.setupProperties();
listProperties.setupProperties();
listProperties.connection.setupLayout();
listProperties.schemaInput.setupLayout();
listProperties.setupLayout();
//
outProperties = new TMarketoOutputProperties("test");
outProperties.connection.setupProperties();
outProperties.connection.endpoint.setValue(ENDPOINT_REST);
outProperties.connection.clientAccessId.setValue(USERID_REST);
outProperties.connection.secretKey.setValue(SECRETKEY_REST);
outProperties.connection.apiMode.setValue(APIMode.REST);
outProperties.schemaInput.setupProperties();
outProperties.setupProperties();
outProperties.connection.setupLayout();
outProperties.schemaInput.setupLayout();
outProperties.setupLayout();
}
use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.
the class MarketoInputReaderTestIT method testLeadActivityREST.
@Test
public void testLeadActivityREST() throws Exception {
TMarketoInputProperties props = getRESTProperties();
props.inputOperation.setValue(getLeadActivity);
String since = new SimpleDateFormat(DATETIME_PATTERN_PARAM).format(new Date(new Date().getTime() - 10000000));
props.sinceDateTime.setValue(since);
props.batchSize.setValue(300);
props.afterInputOperation();
props.beforeMappingInput();
reader = getReader(props);
assertTrue(reader.start());
IndexedRecord r = reader.getCurrent();
assertNotNull(r);
assertTrue(r.getSchema().getFields().size() > 6);
while (reader.advance()) {
r = reader.getCurrent();
assertNotNull(r);
}
// 62 activities (62/10 API Limit)
assertTrue(((int) reader.getReturnValues().get(RETURN_NB_CALL)) >= 6);
// test pagination
props.batchSize.setValue(5);
reader = getReader(props);
assertTrue(reader.start());
r = reader.getCurrent();
assertNotNull(r);
assertTrue(r.getSchema().getFields().size() > 6);
while (reader.advance()) {
r = reader.getCurrent();
assertNotNull(r);
}
assertTrue(((int) reader.getReturnValues().get(RETURN_NB_CALL)) >= 20);
}
Aggregations