NotificationChannelRegistry { public void deleteNotificationChannel(@NonNull final String id) { executor.execute(new Runnable() { @Override public void run() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { notificationManager.deleteNotificationChannel(id); } dataManager.deleteChannel(id); } }); } @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  NotificationChannelRegistry(@NonNull Context context, @NonNull AirshipConfigOptions configOptions); @VisibleForTesting  NotificationChannelRegistry(@NonNull Context context, @NonNull NotificationChannelRegistryDataManager dataManager, @NonNull Executor executor); @NonNull PendingResult<NotificationChannelCompat> getNotificationChannel(@NonNull final String id); @Nullable @WorkerThread NotificationChannelCompat getNotificationChannelSync(@NonNull String id); void deleteNotificationChannel(@NonNull final String id); void createNotificationChannel(@NonNull final NotificationChannelCompat channelCompat); void createDeferredNotificationChannel(@NonNull final NotificationChannelCompat channelCompat); void createNotificationChannels(@XmlRes final int resourceId); void createDeferredNotificationChannels(@XmlRes final int resourceId);  }
@Test @Config(sdk = 25) public void testDeleteNotificationChannelPreOreo() { channelRegistry.deleteNotificationChannel("test"); verify(dataManager).deleteChannel("test"); }
@Test public void testDeleteNotificationChannel() { channelRegistry.deleteNotificationChannel("test"); verify(notificationManager).deleteNotificationChannel("test"); }