Search in sources :

Example 26 with TMarketoInputProperties

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

the class MarketoInputReaderTestIT method testLeadSOAPNotFound.

@Test
public void testLeadSOAPNotFound() throws Exception {
    TMarketoInputProperties props = getSOAPProperties();
    props.inputOperation.setValue(getLead);
    props.leadKeyTypeSOAP.setValue(EMAIL);
    props.batchSize.setValue(1);
    props.afterInputOperation();
    String email = EMAIL_INEXISTANT;
    props.leadKeyValue.setValue(email);
    reader = getReader(props);
    assertFalse(reader.start());
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Test(org.junit.Test)

Example 27 with TMarketoInputProperties

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

the class MarketoInputReaderTestIT method testLeadDynamicSchema.

@Test
public void testLeadDynamicSchema() throws Exception {
    TMarketoInputProperties props = getRESTProperties();
    props.inputOperation.setValue(getLead);
    props.leadKeyTypeREST.setValue(LeadKeyTypeREST.email);
    props.batchSize.setValue(1);
    props.afterInputOperation();
    String email = "undx@undx.net";
    props.leadKeyValue.setValue(email);
    props.schemaInput.schema.setValue(SchemaBuilder.builder().record("test").prop(SchemaConstants.INCLUDE_ALL_FIELDS, "true").fields().endRecord());
    reader = getReader(props);
    assertTrue(reader.start());
    IndexedRecord r = reader.getCurrent();
    assertNotNull(r);
    assertTrue(r.getSchema().getFields().size() > 6);
    assertFalse(reader.advance());
}
Also used : IndexedRecord(org.apache.avro.generic.IndexedRecord) TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Test(org.junit.Test)

Example 28 with TMarketoInputProperties

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

the class MarketoInputReaderTestIT method testLeadSOAPMany.

@Test
public void testLeadSOAPMany() throws Exception {
    TMarketoInputProperties props = getSOAPProperties();
    props.inputOperation.setValue(getLead);
    props.leadKeyTypeSOAP.setValue(EMAIL);
    props.batchSize.setValue(1);
    props.afterInputOperation();
    String email = EMAIL_LEAD_TEST;
    props.leadKeyValue.setValue(email);
    reader = getReader(props);
    assertTrue(reader.start());
    LOG.debug("record = {}.", reader.getCurrent());
    // getLead sets remaingCount to 0.
    assertFalse(reader.advance());
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Test(org.junit.Test)

Example 29 with TMarketoInputProperties

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

the class MarketoInputReaderTestIT method testLeadSOAPSingle.

@Test
public void testLeadSOAPSingle() throws Exception {
    TMarketoInputProperties props = getSOAPProperties();
    props.inputOperation.setValue(getLead);
    props.leadKeyTypeSOAP.setValue(EMAIL);
    props.batchSize.setValue(10);
    props.afterInputOperation();
    String email = EMAIL_LEAD_MANY_INFOS;
    props.leadKeyValue.setValue(email);
    reader = getReader(props);
    assertTrue(reader.start());
    LOG.debug("record = {}.", reader.getCurrent());
    assertFalse(reader.advance());
}
Also used : TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Test(org.junit.Test)

Example 30 with TMarketoInputProperties

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

the class MarketoSOAPClientTestIT method setUp.

@Before
public void setUp() throws Exception {
    inputProperties = new TMarketoInputProperties("test");
    inputProperties.connection.setupProperties();
    inputProperties.connection.endpoint.setValue(ENDPOINT_SOAP);
    inputProperties.connection.clientAccessId.setValue(USERID_SOAP);
    inputProperties.connection.secretKey.setValue(SECRETKEY_SOAP);
    inputProperties.schemaInput.setupProperties();
    inputProperties.mappingInput.setupProperties();
    inputProperties.includeTypes.setupProperties();
    inputProperties.setupProperties();
    inputProperties.connection.apiMode.setValue(SOAP);
    inputProperties.includeTypes.type.setValue(new ArrayList<String>());
    inputProperties.excludeTypes.setupProperties();
    inputProperties.excludeTypes.type.setValue(new ArrayList<String>());
    inputProperties.connection.setupLayout();
    inputProperties.schemaInput.setupLayout();
    inputProperties.setupLayout();
    // 
    listProperties = new TMarketoListOperationProperties("test");
    listProperties.connection.setupProperties();
    listProperties.connection.endpoint.setValue(ENDPOINT_SOAP);
    listProperties.connection.clientAccessId.setValue(USERID_SOAP);
    listProperties.connection.secretKey.setValue(SECRETKEY_SOAP);
    listProperties.schemaInput.setupProperties();
    listProperties.setupProperties();
    listProperties.connection.apiMode.setValue(SOAP);
    listProperties.connection.setupLayout();
    listProperties.schemaInput.setupLayout();
    listProperties.setupLayout();
    // 
    outProperties = new TMarketoOutputProperties("test");
    outProperties.connection.setupProperties();
    outProperties.connection.endpoint.setValue(ENDPOINT_SOAP);
    outProperties.connection.clientAccessId.setValue(USERID_SOAP);
    outProperties.connection.secretKey.setValue(SECRETKEY_SOAP);
    outProperties.schemaInput.setupProperties();
    outProperties.setupProperties();
    outProperties.connection.apiMode.setValue(SOAP);
    outProperties.connection.setupLayout();
    outProperties.schemaInput.setupLayout();
    outProperties.setupLayout();
}
Also used : TMarketoOutputProperties(org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties) TMarketoListOperationProperties(org.talend.components.marketo.tmarketolistoperation.TMarketoListOperationProperties) TMarketoInputProperties(org.talend.components.marketo.tmarketoinput.TMarketoInputProperties) Before(org.junit.Before)

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