Search in sources :

Example 16 with TMarketoInputProperties

use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.

the class MarketoInputReaderTestIT method testLeadActivityWithEmptyActivitiesREST.

@Test(expected = IOException.class)
public void testLeadActivityWithEmptyActivitiesREST() 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.setIncludeTypes.setValue(true);
    // props.includeTypes.type.setValue(Arrays.asList());
    reader = getReader(props);
    assertTrue(reader.start());
    fail("Shouldn't be here");
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Test(org.junit.Test)

Example 17 with TMarketoInputProperties

use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.

the class MarketoInputReaderTestIT method testMultipleLeadsSOAP.

@Test
public void testMultipleLeadsSOAP() throws Exception {
    TMarketoInputProperties props = getSOAPProperties();
    props.inputOperation.setValue(getMultipleLeads);
    props.leadSelectorSOAP.setValue(StaticListSelector);
    props.listParam.setValue(STATIC_LIST_NAME);
    props.listParamListName.setValue(UNDX_TEST_LIST_SMALL);
    props.batchSize.setValue(50);
    props.afterInputOperation();
    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);
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Test(org.junit.Test)

Example 18 with TMarketoInputProperties

use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.

the class MarketoInputReaderTestIT method testLeadActivitySOAP.

@Test
public void testLeadActivitySOAP() throws Exception {
    TMarketoInputProperties props = getSOAPProperties();
    props.inputOperation.setValue(getLeadActivity);
    props.leadKeyTypeSOAP.setValue(EMAIL);
    props.leadSelectorSOAP.setValue(LeadKeySelector);
    props.afterInputOperation();
    props.batchSize.setValue(5);
    // 
    props.leadKeyValue.setValue(EMAIL_LEAD_MANY_INFOS);
    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);
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Test(org.junit.Test)

Example 19 with TMarketoInputProperties

use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.

the class MarketoInputReaderTestIT method getRESTProperties.

public TMarketoInputProperties getRESTProperties() {
    TMarketoInputProperties props = new TMarketoInputProperties("test");
    props.connection.setupProperties();
    props.connection.endpoint.setValue(ENDPOINT_REST);
    props.connection.clientAccessId.setValue(USERID_REST);
    props.connection.secretKey.setValue(SECRETKEY_REST);
    props.connection.apiMode.setValue(REST);
    props.connection.setupLayout();
    props.mappingInput.setupProperties();
    props.setupProperties();
    props.schemaInput.setupProperties();
    props.schemaInput.setupLayout();
    props.includeTypes.setupProperties();
    props.includeTypes.type.setValue(new ArrayList<String>());
    props.excludeTypes.setupProperties();
    props.excludeTypes.type.setValue(new ArrayList<String>());
    props.setupLayout();
    return props;
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties)

Example 20 with TMarketoInputProperties

use of org.talend.components.marketo.tmarketoinput.TMarketoInputProperties in project components by Talend.

the class MarketoInputReaderTestIT method testLeadActivityFailSOAP.

@Test(expected = IOException.class)
public void testLeadActivityFailSOAP() throws Exception {
    TMarketoInputProperties props = getSOAPProperties();
    props.inputOperation.setValue(getLeadActivity);
    props.leadKeyTypeSOAP.setValue(IDNUM);
    props.leadSelectorSOAP.setValue(LeadKeySelector);
    props.afterInputOperation();
    props.batchSize.setValue(5);
    // 
    props.leadKeyValue.setValue("4218473");
    reader = getReader(props);
    reader.start();
    fail("Should not be here");
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Test(org.junit.Test)

Aggregations

TMarketoInputProperties (org.talend.components.marketo.tmarketoinput.TMarketoInputProperties)45 Test (org.junit.Test)25 Before (org.junit.Before)11 IndexedRecord (org.apache.avro.generic.IndexedRecord)10 TMarketoOutputProperties (org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties)9 TMarketoListOperationProperties (org.talend.components.marketo.tmarketolistoperation.TMarketoListOperationProperties)6 Date (java.util.Date)5 Schema (org.apache.avro.Schema)5 SimpleDateFormat (java.text.SimpleDateFormat)4 MarketoRecordResult (org.talend.components.marketo.runtime.client.type.MarketoRecordResult)4 RuntimeContainer (org.talend.components.api.container.RuntimeContainer)2 MarketoRESTClient (org.talend.components.marketo.runtime.client.MarketoRESTClient)2 TMarketoBulkExecProperties (org.talend.components.marketo.tmarketobulkexec.TMarketoBulkExecProperties)2 LeadSelector (org.talend.components.marketo.tmarketoinput.TMarketoInputProperties.LeadSelector)2 NamedThing (org.talend.daikon.NamedThing)2 ValidationResult (org.talend.daikon.properties.ValidationResult)2 ValidationResultMutable (org.talend.daikon.properties.ValidationResultMutable)2 Gson (com.google.gson.Gson)1 AuthenticationHeader (com.marketo.mktows.AuthenticationHeader)1 MktowsPort (com.marketo.mktows.MktowsPort)1