Configuration implements CallbackAware, MetadataAware, UserAware { public void setDelivery(@NonNull Delivery delivery) { if (delivery != null) { impl.setDelivery(delivery); } else { logNull("delivery"); } } Configuration(@NonNull String apiKey); @NonNull static Configuration load(@NonNull Context context); @NonNull String getApiKey(); void setApiKey(@NonNull String apiKey); @Nullable String getAppVersion(); void setAppVersion(@Nullable String appVersion); @Nullable Integer getVersionCode(); void setVersionCode(@Nullable Integer versionCode); @Nullable String getReleaseStage(); void setReleaseStage(@Nullable String releaseStage); @NonNull ThreadSendPolicy getSendThreads(); void setSendThreads(@NonNull ThreadSendPolicy sendThreads); boolean getPersistUser(); void setPersistUser(boolean persistUser); long getLaunchCrashThresholdMs(); void setLaunchCrashThresholdMs(long launchCrashThresholdMs); boolean getAutoTrackSessions(); void setAutoTrackSessions(boolean autoTrackSessions); @NonNull ErrorTypes getEnabledErrorTypes(); void setEnabledErrorTypes(@NonNull ErrorTypes enabledErrorTypes); boolean getAutoDetectErrors(); void setAutoDetectErrors(boolean autoDetectErrors); @Nullable String getAppType(); void setAppType(@Nullable String appType); @Nullable Logger getLogger(); void setLogger(@Nullable Logger logger); @NonNull Delivery getDelivery(); void setDelivery(@NonNull Delivery delivery); @NonNull EndpointConfiguration getEndpoints(); void setEndpoints(@NonNull EndpointConfiguration endpoints); int getMaxBreadcrumbs(); void setMaxBreadcrumbs(int maxBreadcrumbs); @Nullable String getContext(); void setContext(@Nullable String context); @NonNull Set<String> getRedactedKeys(); void setRedactedKeys(@NonNull Set<String> redactedKeys); @NonNull Set<String> getDiscardClasses(); void setDiscardClasses(@NonNull Set<String> discardClasses); @Nullable Set<String> getEnabledReleaseStages(); void setEnabledReleaseStages(@Nullable Set<String> enabledReleaseStages); @Nullable Set<BreadcrumbType> getEnabledBreadcrumbTypes(); void setEnabledBreadcrumbTypes(@Nullable Set<BreadcrumbType> enabledBreadcrumbTypes); @NonNull Set<String> getProjectPackages(); void setProjectPackages(@NonNull Set<String> projectPackages); @Override void addOnError(@NonNull OnErrorCallback onError); @Override void removeOnError(@NonNull OnErrorCallback onError); @Override void addOnBreadcrumb(@NonNull OnBreadcrumbCallback onBreadcrumb); @Override void removeOnBreadcrumb(@NonNull OnBreadcrumbCallback onBreadcrumb); @Override void addOnSession(@NonNull OnSessionCallback onSession); @Override void removeOnSession(@NonNull OnSessionCallback onSession); @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); @Nullable @Override Map<String, Object> getMetadata(@NonNull String section); @Nullable @Override Object getMetadata(@NonNull String section, @NonNull String key); @NonNull @Override User getUser(); @Override void setUser(@Nullable String id, @Nullable String email, @Nullable String name); void addPlugin(@NonNull Plugin plugin);  }
@Test public void testSetDelivery() { Configuration configuration = new Configuration("5d1ec5bd39a74caa1267142706a7fb21"); assertNull(configuration.getDelivery()); Delivery delivery = new Delivery() { @NotNull @Override public DeliveryStatus deliver(@NotNull Session payload, @NotNull DeliveryParams deliveryParams) { return null; } @NotNull @Override public DeliveryStatus deliver(@NotNull EventPayload payload, @NotNull DeliveryParams deliveryParams) { return null; } }; configuration.setDelivery(delivery); assertFalse(configuration.getDelivery() instanceof DefaultDelivery); assertEquals(delivery, configuration.getDelivery()); }