1212import com .microsoft .azure .mobile .crashes .ingestion .models .ManagedErrorLog ;
1313import com .microsoft .azure .mobile .crashes .ingestion .models .StackFrame ;
1414import com .microsoft .azure .mobile .crashes .ingestion .models .json .ManagedErrorLogFactory ;
15- import com .microsoft .azure .mobile .crashes .model .ErrorAttachment ;
1615import com .microsoft .azure .mobile .crashes .model .ErrorReport ;
1716import com .microsoft .azure .mobile .crashes .model .TestCrashException ;
1817import com .microsoft .azure .mobile .crashes .utils .ErrorLogHelper ;
@@ -292,11 +291,14 @@ public void queuePendingCrashesShouldProcess() throws IOException, ClassNotFound
292291 when (StorageHelper .InternalStorage .read (any (File .class ))).thenReturn ("" );
293292 when (StorageHelper .InternalStorage .readObject (any (File .class ))).thenReturn (new RuntimeException ());
294293
295- ErrorAttachment mockAttachment = mock (ErrorAttachment .class );
294+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
295+ // ErrorAttachment mockAttachment = mock(ErrorAttachment.class);
296296 CrashesListener mockListener = mock (CrashesListener .class );
297297 when (mockListener .shouldProcess (report )).thenReturn (true );
298298 when (mockListener .shouldAwaitUserConfirmation ()).thenReturn (false );
299- when (mockListener .getErrorAttachment (report )).thenReturn (mockAttachment );
299+
300+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
301+ // when(mockListener.getErrorAttachment(report)).thenReturn(mockAttachment);
300302
301303 Crashes crashes = Crashes .getInstance ();
302304 LogSerializer logSerializer = mock (LogSerializer .class );
@@ -308,7 +310,9 @@ public void queuePendingCrashesShouldProcess() throws IOException, ClassNotFound
308310
309311 verify (mockListener ).shouldProcess (report );
310312 verify (mockListener ).shouldAwaitUserConfirmation ();
311- verify (mockListener ).getErrorAttachment (report );
313+
314+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
315+ // verify(mockListener).getErrorAttachment(report);
312316 verify (mockChannel ).enqueue (argThat (new ArgumentMatcher <Log >() {
313317 @ Override
314318 public boolean matches (Object log ) {
@@ -344,7 +348,9 @@ public void queuePendingCrashesShouldNotProcess() throws IOException, ClassNotFo
344348
345349 verify (mockListener ).shouldProcess (report );
346350 verify (mockListener , never ()).shouldAwaitUserConfirmation ();
347- verify (mockListener , never ()).getErrorAttachment (report );
351+
352+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
353+ // verify(mockListener, never()).getErrorAttachment(report);
348354 verify (mockChannel , never ()).enqueue (any (Log .class ), eq (crashes .getGroupName ()));
349355 }
350356
@@ -376,7 +382,9 @@ public void queuePendingCrashesAlwaysSend() throws IOException, ClassNotFoundExc
376382
377383 verify (mockListener ).shouldProcess (report );
378384 verify (mockListener , never ()).shouldAwaitUserConfirmation ();
379- verify (mockListener ).getErrorAttachment (report );
385+
386+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
387+ // verify(mockListener).getErrorAttachment(report);
380388 verify (mockChannel ).enqueue (argThat (new ArgumentMatcher <Log >() {
381389 @ Override
382390 public boolean matches (Object log ) {
@@ -469,6 +477,13 @@ public void disabledDuringHandleUserConfirmation() throws IOException, ClassNotF
469477 LogSerializer logSerializer = mock (LogSerializer .class );
470478 when (logSerializer .deserializeLog (anyString ())).thenReturn (mErrorLog ).thenReturn (errorLog );
471479 Channel channel = mock (Channel .class );
480+ doAnswer (new Answer <Object >() {
481+ @ Override
482+ public Object answer (InvocationOnMock invocation ) throws Throwable {
483+ Crashes .setEnabled (false );
484+ return null ;
485+ }
486+ }).when (channel ).enqueue (any (Log .class ), anyString ());
472487
473488 mockStatic (ErrorLogHelper .class );
474489 when (ErrorLogHelper .getStoredErrorLogFiles ()).thenReturn (new File []{mock (File .class ), mock (File .class )});
@@ -480,14 +495,6 @@ public void disabledDuringHandleUserConfirmation() throws IOException, ClassNotF
480495 when (StorageHelper .InternalStorage .readObject (any (File .class ))).thenReturn (EXCEPTION );
481496 when (StorageHelper .InternalStorage .read (any (File .class ))).thenReturn ("" );
482497
483- when (listener .getErrorAttachment (errorReport1 )).thenAnswer (new Answer <ErrorAttachment >() {
484- @ Override
485- public ErrorAttachment answer (InvocationOnMock invocation ) throws Throwable {
486- Crashes .setEnabled (false );
487- return null ;
488- }
489- });
490-
491498 Crashes crashes = Crashes .getInstance ();
492499 crashes .setLogSerializer (logSerializer );
493500 crashes .setInstanceListener (listener );
@@ -497,7 +504,9 @@ public ErrorAttachment answer(InvocationOnMock invocation) throws Throwable {
497504 verify (listener , times (2 )).shouldProcess (any (ErrorReport .class ));
498505 verify (listener ).shouldAwaitUserConfirmation ();
499506 verify (channel ).enqueue (any (Log .class ), anyString ());
500- verify (listener ).getErrorAttachment (any (ErrorReport .class ));
507+
508+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
509+ // verify(listener).getErrorAttachment(any(ErrorReport.class));
501510 verifyNoMoreInteractions (listener );
502511 }
503512
@@ -712,7 +721,8 @@ public void handleUserConfirmationDoNotSend() throws IOException, ClassNotFoundE
712721
713722 Crashes .notifyUserConfirmation (Crashes .DONT_SEND );
714723
715- verify (mockListener , never ()).getErrorAttachment (any (ErrorReport .class ));
724+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
725+ // verify(mockListener, never()).getErrorAttachment(any(ErrorReport.class));
716726 verify (mMockLooper ).quit ();
717727
718728 verifyStatic ();
@@ -813,10 +823,11 @@ public boolean shouldAwaitUserConfirmation() {
813823 return false ;
814824 }
815825
816- @ Override
817- public ErrorAttachment getErrorAttachment (ErrorReport report ) {
818- return null ;
819- }
826+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
827+ // @Override
828+ // public ErrorAttachment getErrorAttachment(ErrorReport report) {
829+ // return null;
830+ // }
820831
821832 @ Override
822833 public void onBeforeSending (ErrorReport report ) {
@@ -841,7 +852,8 @@ public void onSendingSucceeded(ErrorReport report) {
841852 assertFalse (defaultListener .shouldAwaitUserConfirmation ());
842853
843854 /* Nothing to verify. */
844- defaultListener .getErrorAttachment (null );
855+ /* TODO (getErrorAttachment): Re-enable error attachment when the feature becomes available. */
856+ // defaultListener.getErrorAttachment(null);
845857 defaultListener .onBeforeSending (null );
846858 defaultListener .onSendingSucceeded (null );
847859 defaultListener .onSendingFailed (null , null );
0 commit comments