@Test public void shouldUseOnFailHandler() throws IOException { when(raygunConnectionMock.getConnection(anyString())).thenThrow(new IOException()); raygunClient.onFailedSend = mock(IRaygunOnFailedSend.class); raygunClient.onAfterSend = mock(IRaygunOnAfterSend.class); assertThat(raygunClient.send(new RaygunMessage()), is(-1)); verify(raygunClient.onFailedSend, times(1)).onFailedSend(eq(raygunClient), anyString()); verify(raygunClient.onAfterSend, times(0)).onAfterSend(eq(raygunClient), (RaygunMessage) anyObject()); }
public int send(Throwable throwable) { return send(throwable, null, null); }
RaygunClient { public int send(Throwable throwable) { return send(throwable, null, null); } }
RaygunClient { public int send(Throwable throwable) { return send(throwable, null, null); } RaygunClient(String apiKey); }
RaygunClient { public int send(Throwable throwable) { return send(throwable, null, null); } RaygunClient(String apiKey); void setRaygunConnection(RaygunConnection raygunConnection); void setUser(RaygunIdentifier userIdentity); void setVersion(String version); void setVersionFrom(Class getVersionFrom); int send(Throwable throwable); int send(Throwable throwable, Set<String> tags); int send(Throwable throwable, Map data); int send(Throwable throwable, Set<String> tags, Map data); int sendUnhandled(Throwable throwable); int sendUnhandled(Throwable throwable, Map data); int sendUnhandled(Throwable throwable, Set<String> tags); int sendUnhandled(Throwable throwable, Set<String> tags, Map data); RaygunMessage buildMessage(Throwable throwable, Set<String> errorTags, Map errorData); int send(RaygunMessage raygunMessage); int send(String payload); String toJson(Object o); void setOnBeforeSend(IRaygunOnBeforeSend onBeforeSend); void setOnAfterSend(IRaygunOnAfterSend onAfterSend); void setOnFailedSend(IRaygunOnFailedSend onFailedSend); IRaygunOnBeforeSend getOnBeforeSend(); IRaygunOnAfterSend getOnAfterSend(); boolean shouldProcessBreadcrumbLocation(); void shouldProcessBreadcrumbLocation(boolean shouldProcessBreadcrumbLocation); RaygunBreadcrumbMessage recordBreadcrumb(String message); RaygunBreadcrumbMessage recordBreadcrumb(RaygunBreadcrumbMessage breadcrumb); RaygunClient withTag(String tag); Set<String> getTags(); void setTags(Set<String> tags); Map<?, ?> getData(); void setData(Map<?, ?> data); RaygunClient withData(Object key, Object value); void ClearBreadcrumbs(); static RaygunBreadcrumbMessage processBreadCrumbCodeLocation(boolean process, RaygunBreadcrumbMessage breadcrumbMessage, int stackFrame); }
RaygunClient { public int send(Throwable throwable) { return send(throwable, null, null); } RaygunClient(String apiKey); void setRaygunConnection(RaygunConnection raygunConnection); void setUser(RaygunIdentifier userIdentity); void setVersion(String version); void setVersionFrom(Class getVersionFrom); int send(Throwable throwable); int send(Throwable throwable, Set<String> tags); int send(Throwable throwable, Map data); int send(Throwable throwable, Set<String> tags, Map data); int sendUnhandled(Throwable throwable); int sendUnhandled(Throwable throwable, Map data); int sendUnhandled(Throwable throwable, Set<String> tags); int sendUnhandled(Throwable throwable, Set<String> tags, Map data); RaygunMessage buildMessage(Throwable throwable, Set<String> errorTags, Map errorData); int send(RaygunMessage raygunMessage); int send(String payload); String toJson(Object o); void setOnBeforeSend(IRaygunOnBeforeSend onBeforeSend); void setOnAfterSend(IRaygunOnAfterSend onAfterSend); void setOnFailedSend(IRaygunOnFailedSend onFailedSend); IRaygunOnBeforeSend getOnBeforeSend(); IRaygunOnAfterSend getOnAfterSend(); boolean shouldProcessBreadcrumbLocation(); void shouldProcessBreadcrumbLocation(boolean shouldProcessBreadcrumbLocation); RaygunBreadcrumbMessage recordBreadcrumb(String message); RaygunBreadcrumbMessage recordBreadcrumb(RaygunBreadcrumbMessage breadcrumb); RaygunClient withTag(String tag); Set<String> getTags(); void setTags(Set<String> tags); Map<?, ?> getData(); void setData(Map<?, ?> data); RaygunClient withData(Object key, Object value); void ClearBreadcrumbs(); static RaygunBreadcrumbMessage processBreadCrumbCodeLocation(boolean process, RaygunBreadcrumbMessage breadcrumbMessage, int stackFrame);  }