Event implements JsonStream.Streamable, MetadataAware, UserAware { @NonNull public List<Error> getErrors() { return impl.getErrors(); } Event(@Nullable Throwable originalError,
          @NonNull ImmutableConfig config,
          @NonNull HandledState handledState,
          @NonNull Logger logger);   Event(@Nullable Throwable originalError,
          @NonNull ImmutableConfig config,
          @NonNull HandledState handledState,
          @NonNull Metadata metadata,
          @NonNull Logger logger);   Event(@NonNull EventInternal impl, @NonNull Logger logger); @Nullable Throwable getOriginalError(); @NonNull List<Error> getErrors(); @NonNull List<Thread> getThreads(); @NonNull List<Breadcrumb> getBreadcrumbs(); @NonNull AppWithState getApp(); @NonNull DeviceWithState getDevice(); void setApiKey(@NonNull String apiKey); @NonNull String getApiKey(); void setSeverity(@NonNull Severity severity); @NonNull Severity getSeverity(); void setGroupingHash(@Nullable String groupingHash); @Nullable String getGroupingHash(); void setContext(@Nullable String context); @Nullable String getContext(); @Override void setUser(@Nullable String id, @Nullable String email, @Nullable String name); @Override @NonNull User getUser(); @Override void addMetadata(@NonNull String section, @NonNull Map<String, ?> value); @Override void addMetadata(@NonNull String section, @NonNull String key, @Nullable Object value); @Override void clearMetadata(@NonNull String section); @Override void clearMetadata(@NonNull String section, @NonNull String key); @Override @Nullable Map<String, Object> getMetadata(@NonNull String section); @Override @Nullable Object getMetadata(@NonNull String section, @NonNull String key); @Override void toStream(@NonNull JsonStream stream); boolean isUnhandled();  }
@Test public void checkExceptionMessageNullity() { Event err = new Event(new RuntimeException(), config, handledState, NoopLogger.INSTANCE); assertNull(err.getErrors().get(0).getErrorMessage()); }
@Test public void testExceptionName() { RuntimeException exc = new RuntimeException("whoops"); Event err = new Event(exc, config, handledState, NoopLogger.INSTANCE); err.getErrors().get(0).setErrorClass("Busgang"); assertEquals("Busgang", err.getErrors().get(0).getErrorClass()); }
@Test public void testGetSetErrors() { RuntimeException testRuntimeException = new RuntimeException("Something went wrong"); Event testEvent = new Event(testRuntimeException, config, handledState, NoopLogger.INSTANCE); List<Error> errors = testEvent.getErrors(); assertEquals(testRuntimeException.getClass().getName(), errors.get(0).getErrorClass()); assertEquals(testRuntimeException.getMessage(), errors.get(0).getErrorMessage()); }
@Test public void testIsAnr() { RuntimeException exc = new RuntimeException("Something went wrong"); Event event = new Event(exc, config, handledState, NoopLogger.INSTANCE); assertFalse(event.impl.isAnr(event)); event.getErrors().get(0).setErrorClass("ANR"); assertTrue(event.impl.isAnr(event)); event.getErrors().clear(); assertFalse(event.impl.isAnr(event)); }