use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.
the class MarketoLeadClientTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
iprops = new TMarketoInputProperties("test");
iprops.schemaInput.setupProperties();
iprops.schemaInput.setupLayout();
iprops.connection.setupProperties();
iprops.connection.setupLayout();
iprops.connection.setupProperties();
iprops.connection.endpoint.setValue("https://fake.io/rest");
iprops.connection.clientAccessId.setValue("clientaccess");
iprops.connection.secretKey.setValue("sekret");
// shorten interval for tests
iprops.connection.attemptsIntervalTime.setValue(200);
iprops.setupProperties();
iprops.setupLayout();
oprops = new TMarketoOutputProperties("test");
oprops.schemaInput.setupProperties();
oprops.schemaInput.setupLayout();
oprops.connection.setupProperties();
oprops.connection.setupLayout();
oprops.connection.setupProperties();
oprops.connection.endpoint.setValue("https://fake.io/rest");
oprops.connection.clientAccessId.setValue("clientaccess");
oprops.connection.secretKey.setValue("sekret");
// shorten interval for tests
oprops.connection.attemptsIntervalTime.setValue(200);
oprops.setupProperties();
oprops.setupLayout();
lprops = new TMarketoListOperationProperties("test");
lprops.schemaInput.setupProperties();
lprops.schemaInput.setupLayout();
lprops.connection.setupProperties();
lprops.connection.setupLayout();
lprops.connection.setupProperties();
lprops.connection.endpoint.setValue("https://fake.io/rest");
lprops.connection.clientAccessId.setValue("clientaccess");
lprops.connection.secretKey.setValue("sekret");
// shorten interval for tests
lprops.connection.attemptsIntervalTime.setValue(200);
lprops.setupProperties();
lprops.setupLayout();
client = spy(new MarketoRESTClient(iprops.connection));
doNothing().when(client).getToken();
doReturn("000123456").when(client).getPageToken(anyString());
client.connect();
}
use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.
the class MarketoSOAPClientTest method setUp.
@Before
public void setUp() throws Exception {
iprops = new TMarketoInputProperties("test");
iprops.schemaInput.setupProperties();
iprops.schemaInput.setupLayout();
iprops.connection.setupProperties();
iprops.connection.setupLayout();
iprops.connection.setupProperties();
iprops.connection.apiMode.setValue(APIMode.SOAP);
iprops.connection.endpoint.setValue("https://fake.io");
iprops.connection.clientAccessId.setValue("clientaccess");
iprops.connection.secretKey.setValue("sekret");
iprops.setupProperties();
iprops.setupLayout();
oprops = new TMarketoOutputProperties("test");
oprops.schemaInput.setupProperties();
oprops.schemaInput.setupLayout();
oprops.connection.setupProperties();
oprops.connection.setupLayout();
oprops.connection.setupProperties();
oprops.connection.apiMode.setValue(APIMode.SOAP);
oprops.connection.endpoint.setValue("https://fake.io");
oprops.connection.clientAccessId.setValue("clientaccess");
oprops.connection.secretKey.setValue("sekret");
oprops.setupProperties();
oprops.setupLayout();
lprops = new TMarketoListOperationProperties("test");
lprops.schemaInput.setupProperties();
lprops.schemaInput.setupLayout();
lprops.connection.setupProperties();
lprops.connection.setupLayout();
lprops.connection.setupProperties();
lprops.connection.apiMode.setValue(APIMode.SOAP);
lprops.connection.endpoint.setValue("https://fake.io");
lprops.connection.clientAccessId.setValue("clientaccess");
lprops.connection.secretKey.setValue("sekret");
lprops.setupProperties();
lprops.setupLayout();
client = spy(new MarketoSOAPClient(iprops.connection));
port = mock(MktowsPort.class);
AuthenticationHeader header = mock(AuthenticationHeader.class);
doReturn(port).when(client).getMktowsApiSoapPort();
doReturn(header).when(client).getAuthentificationHeader();
doReturn(null).when(port).listMObjects(any(ParamsListMObjects.class), any(AuthenticationHeader.class));
client.connect();
objectFactory = new ObjectFactory();
factory = DatatypeFactory.newInstance();
Date dateTest = MarketoUtils.parseDateString(DATE_EXPECTED);
gcDateTest = new GregorianCalendar();
gcDateTest.setTime(dateTest);
}
use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.
the class MarketoWriteOperationTest method testCreateWriter.
@Test
public void testCreateWriter() throws Exception {
MarketoSink sink = new MarketoSink();
TMarketoListOperationProperties plist = new TMarketoListOperationProperties("test");
plist.init();
TMarketoOutputProperties pout = new TMarketoOutputProperties("test");
pout.init();
TMarketoInputProperties pin = new TMarketoInputProperties("test");
pin.init();
sink.initialize(null, null);
wop = new MarketoWriteOperation(sink);
assertNull(wop.createWriter(null));
sink.initialize(null, plist);
wop = new MarketoWriteOperation(sink);
assertEquals(MarketoListOperationWriter.class, wop.createWriter(null).getClass());
sink.initialize(null, pout);
wop = new MarketoWriteOperation(sink);
assertEquals(MarketoOutputWriter.class, wop.createWriter(null).getClass());
sink.initialize(null, pin);
wop = new MarketoWriteOperation(sink);
assertEquals(MarketoInputWriter.class, wop.createWriter(null).getClass());
}
use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.
the class MarketoOutputWriteOperationTest method setUp.
@Before
public void setUp() throws Exception {
TMarketoOutputProperties p = new TMarketoOutputProperties("tests");
p.init();
MarketoSink sink = new MarketoSink();
sink.initialize(null, p);
wop = new MarketoWriteOperation(sink);
wop.initialize(null);
}
use of org.talend.components.marketo.tmarketooutput.TMarketoOutputProperties in project components by Talend.
the class MarketoOutputWriterTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
props = new TMarketoOutputProperties("test");
props.connection.setupProperties();
props.setupProperties();
props.outputOperation.setValue(OutputOperation.deleteLeads);
props.batchSize.setValue(1);
props.updateSchemaRelated();
when(sink.getProperties()).thenReturn(props);
writer = new MarketoOutputWriter(new MarketoWriteOperation(sink), null);
}
Aggregations