use of org.talend.components.marketo.runtime.client.type.MarketoError in project components by Talend.
the class MarketoBaseRESTClientTest method testIsErrorRecoverable.
@Test
public void testIsErrorRecoverable() throws Exception {
MarketoError error = new MarketoException("REST", "602", "Access token expired").toMarketoError();
assertTrue(client.isErrorRecoverable(Arrays.asList(error)));
for (String code : new String[] { "502", "604", "606", "608", "611", "614", "615" }) {
error = new MarketoException("REST", code, "API Temporarily Unavailable").toMarketoError();
assertTrue(client.isErrorRecoverable(Arrays.asList(error)));
}
error = new MarketoException("REST", "404", "Page not found").toMarketoError();
assertFalse(client.isErrorRecoverable(Arrays.asList(error)));
}
use of org.talend.components.marketo.runtime.client.type.MarketoError in project components by Talend.
the class MarketoBaseRESTClientTest method testIsAccessTokenExpired.
@Test
public void testIsAccessTokenExpired() throws Exception {
assertFalse(client.isAccessTokenExpired(null));
MarketoError error = new MarketoException("REST", "602", "Access token expired").toMarketoError();
assertTrue(client.isAccessTokenExpired(Arrays.asList(error)));
}
Aggregations