Search in sources :

Example 1 with ListRecord

use of org.talend.components.marketo.runtime.client.rest.type.ListRecord in project components by Talend.

the class MarketoLeadClientTest method testGetListIdByName.

@Test
public void testGetListIdByName() throws Exception {
    doReturn(null).when(client).executeGetRequest(StaticListResult.class);
    try {
        client.getListIdByName("test_list");
        fail("Should not be here");
    } catch (MarketoException e) {
    }
    StaticListResult rr = new StaticListResult();
    rr.setSuccess(true);
    ListRecord lr = new ListRecord();
    lr.setId(666);
    rr.setResult(Arrays.asList(lr));
    doReturn(rr).when(client).executeGetRequest(StaticListResult.class);
    assertEquals(Integer.valueOf(666), client.getListIdByName("test_list"));
}
Also used : StaticListResult(org.talend.components.marketo.runtime.client.rest.response.StaticListResult) MarketoException(org.talend.components.marketo.runtime.client.type.MarketoException) ListRecord(org.talend.components.marketo.runtime.client.rest.type.ListRecord) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 StaticListResult (org.talend.components.marketo.runtime.client.rest.response.StaticListResult)1 ListRecord (org.talend.components.marketo.runtime.client.rest.type.ListRecord)1 MarketoException (org.talend.components.marketo.runtime.client.type.MarketoException)1