Search in sources :

Example 1 with MarketoClientService

use of org.talend.components.marketo.runtime.client.MarketoClientService in project components by Talend.

the class MarketoInputReaderTestIT method testTDI38956.

@Test
public void testTDI38956() throws Exception {
    TMarketoInputProperties props = getRESTProperties();
    props.inputOperation.setValue(getLead);
    props.leadKeyTypeREST.setValue(email);
    props.afterInputOperation();
    String email = EMAIL_LEAD_TEST;
    props.leadKeyValue.setValue(email);
    MarketoSource source = new MarketoSource();
    source.initialize(null, props);
    MarketoClientService client = source.getClientService(null);
    MarketoRecordResult result = client.getLead(props, null);
    LOG.debug("{}", result);
    List<IndexedRecord> records = result.getRecords();
    assertNotEquals(emptyList(), records);
    IndexedRecord record = records.get(0);
    assertNotNull(record);
    // createdAt shouldn't be null
    assertNotNull(record.get(4));
    // updatedAt shouldn't be null
    assertNotNull(record.get(5));
}
Also used : MarketoClientService(org.talend.components.marketo.runtime.client.MarketoClientService) IndexedRecord(org.apache.avro.generic.IndexedRecord) TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) MarketoRecordResult(org.talend.components.marketo.runtime.client.type.MarketoRecordResult) Test(org.junit.Test)

Aggregations

IndexedRecord (org.apache.avro.generic.IndexedRecord)1 Test (org.junit.Test)1 MarketoClientService (org.talend.components.marketo.runtime.client.MarketoClientService)1 MarketoRecordResult (org.talend.components.marketo.runtime.client.type.MarketoRecordResult)1 TMarketoInputProperties (org.talend.components.marketo.tmarketoinput.TMarketoInputProperties)1