WrapperSdkExceptionManager { public static void deleteWrapperExceptionData(UUID errorId) { if (errorId == null) { AppCenterLog.error(LOG_TAG, "Failed to delete wrapper exception data: null errorId"); return; } File dataFile = getFile(errorId); if (dataFile.exists()) { String loadResult = loadWrapperExceptionData(errorId); if (loadResult == null) { AppCenterLog.error(LOG_TAG, "Failed to load wrapper exception data."); } FileManager.delete(dataFile); } } @VisibleForTesting  WrapperSdkExceptionManager(); static UUID saveWrapperException(Thread thread, Throwable throwable, com.microsoft.appcenter.crashes.ingestion.models.Exception modelException, String rawSerializedException); static void deleteWrapperExceptionData(UUID errorId); static String loadWrapperExceptionData(UUID errorId); static String trackException(com.microsoft.appcenter.crashes.ingestion.models.Exception modelException, Map<String, String> properties, Iterable<ErrorAttachmentLog> attachments); static void setAutomaticProcessing(@SuppressWarnings("SameParameterValue") boolean automaticProcessing); static AppCenterFuture<Collection<ErrorReport>> getUnprocessedErrorReports(); static AppCenterFuture<Boolean> sendCrashReportsOrAwaitUserConfirmation(Collection<String> filteredReportIds); static ErrorReport buildHandledErrorReport(Context context, String errorReportId); static void sendErrorAttachments(String errorReportId, Iterable<ErrorAttachmentLog> attachments);  }
@Test public void deleteWrapperExceptionDataWithNullId() { WrapperSdkExceptionManager.deleteWrapperExceptionData(null); verifyStatic(never()); FileManager.delete(any(File.class)); verifyStatic(); AppCenterLog.error(eq(Crashes.LOG_TAG), anyString()); }
@Test public void deleteWrapperExceptionDataWithMissingId() { WrapperSdkExceptionManager.deleteWrapperExceptionData(UUID.randomUUID()); verifyStatic(never()); FileManager.delete(any(File.class)); verifyStatic(never()); AppCenterLog.error(eq(Crashes.LOG_TAG), anyString()); }
@Test public void deleteWrapperExceptionDataWithLoadingError() throws java.lang.Exception { File file = mock(File.class); whenNew(File.class).withAnyArguments().thenReturn(file); when(file.exists()).thenReturn(true); WrapperSdkExceptionManager.deleteWrapperExceptionData(UUID.randomUUID()); verifyStatic(); FileManager.delete(any(File.class)); verifyStatic(); AppCenterLog.error(eq(Crashes.LOG_TAG), anyString()); }