test_class.declarator: mActorRef
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ActorRef<ActorInterface> mActorRef;
test_class.type: ActorRef<ActorInterface>
test_class.var_name: mActorRef
test_class.declarator: mActorImpl
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ActorInterface mActorImpl;
test_class.type: ActorInterface
test_class.var_name: mActorImpl
test_class.declarator: mUiThread
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ActorThread mUiThread;
test_class.type: ActorThread
test_class.var_name: mUiThread
test_class.declarator: mActors
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ActorsThreadsBase mActors;
test_class.type: ActorsThreadsBase
test_class.var_name: mActors
test_class.declarator: mPromise
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Promise<String> mPromise;
test_class.type: Promise<String>
test_class.var_name: mPromise
test_class.declarator: mActionHandle
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ActionHandle mActionHandle;
test_class.type: ActionHandle
test_class.var_name: mActionHandle
test_class.declarator: mLoader
test_class.modifier: private
test_class.original_string: private ActorCallLoader<ActorInterface, String> mLoader;
test_class.type: ActorCallLoader<ActorInterface, String>
test_class.var_name: mLoader
test_class.declarator: mResultCaptor
test_class.modifier: private
test_class.original_string: private ResultCaptor mResultCaptor;
test_class.type: ResultCaptor
test_class.var_name: mResultCaptor
test_class.declarator: mCleanupCaptor
test_class.modifier: private
test_class.original_string: private CleanupCaptor mCleanupCaptor;
test_class.type: CleanupCaptor
test_class.var_name: mCleanupCaptor
test_class.file: actors-library/src/test/java/com/truecaller/androidactors/ActorCallLoaderTest.java
test_class.identifier: ActorCallLoaderTest
test_case.body: @SuppressWarnings("unchecked")
      @Test
      public void redeliverResult() {
          mLoader.onStartLoading();
          final ArgumentCaptor<ResultListener> captor = ArgumentCaptor.forClass(ResultListener.class);
          Mockito.verify(mPromise).then(Mockito.same(mUiThread), captor.capture());
          ResultListener listener = captor.getValue();
          Assert.assertNotNull(listener);
          listener.onResult("Test");
          // Check that result was delivered
          Assert.assertTrue(mResultCaptor.resultDelivered);
          Assert.assertEquals("Test", mResultCaptor.result);
  
          // Second call should redeliver result
          Mockito.reset(mActorImpl);
          mResultCaptor.result = null;
          mResultCaptor.resultDelivered = false;
          mLoader.onStartLoading();
          Mockito.verifyZeroInteractions(mActorImpl);
          // but result should be redelivered
          Assert.assertTrue(mResultCaptor.resultDelivered);
          Assert.assertEquals("Test", mResultCaptor.result);
      }
test_case.class_method_signature: ActorCallLoaderTest.redeliverResult()
test_case.full_signature: @SuppressWarnings("unchecked") @Test public void redeliverResult()
test_case.identifier: redeliverResult
test_case.invocations: onStartLoading forClass then verify same capture getValue assertNotNull onResult assertTrue assertEquals reset onStartLoading verifyZeroInteractions assertTrue assertEquals
test_case.modifiers: @SuppressWarnings("unchecked") @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void redeliverResult()
focal_class.declarator: STATE_NONE = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int STATE_NONE = 0;
focal_class.type: int
focal_class.var_name: STATE_NONE
focal_class.declarator: STATE_CALLING = 1
focal_class.modifier: private static final
focal_class.original_string: private static final int STATE_CALLING = 1;
focal_class.type: int
focal_class.var_name: STATE_CALLING
focal_class.declarator: STATE_DONE = 2
focal_class.modifier: private static final
focal_class.original_string: private static final int STATE_DONE = 2;
focal_class.type: int
focal_class.var_name: STATE_DONE
focal_class.declarator: mActorsThreads
focal_class.modifier: @NonNull
      private final
focal_class.original_string: @NonNull
      private final ActorsThreads mActorsThreads;
focal_class.type: ActorsThreads
focal_class.var_name: mActorsThreads
focal_class.declarator: mActorRef
focal_class.modifier: @NonNull
      private final
focal_class.original_string: @NonNull
      private final ActorRef<A> mActorRef;
focal_class.type: ActorRef<A>
focal_class.var_name: mActorRef
focal_class.declarator: mState = STATE_NONE
focal_class.modifier: private
focal_class.original_string: private int mState = STATE_NONE;
focal_class.type: int
focal_class.var_name: mState
focal_class.declarator: mResult
focal_class.modifier: @Nullable
      private
focal_class.original_string: @Nullable
      private R mResult;
focal_class.type: R
focal_class.var_name: mResult
focal_class.declarator: mActionHandle
focal_class.modifier: @Nullable
      private
focal_class.original_string: @Nullable
      private ActionHandle mActionHandle;
focal_class.type: ActionHandle
focal_class.var_name: mActionHandle
focal_class.declarator: mListener
focal_class.modifier: @Nullable
      private
focal_class.original_string: @Nullable
      private CallResultListener mListener;
focal_class.type: CallResultListener
focal_class.var_name: mListener
focal_class.file: actors-library/src/main/java/com/truecaller/androidactors/ActorCallLoader.java
focal_class.identifier: ActorCallLoader
focal_class.class_method_signature: ActorCallLoader.ActorCallLoader(@NonNull Context context, @NonNull ActorsThreads actors, @NonNull ActorRef<A> actorRef)
focal_class.full_signature: public  ActorCallLoader(@NonNull Context context, @NonNull ActorsThreads actors, @NonNull ActorRef<A> actorRef)
focal_class.identifier: ActorCallLoader
focal_class.modifiers: public
focal_class.parameters: (@NonNull Context context, @NonNull ActorsThreads actors, @NonNull ActorRef<A> actorRef)
focal_class.signature:  ActorCallLoader(@NonNull Context context, @NonNull ActorsThreads actors, @NonNull ActorRef<A> actorRef)
focal_class.class_method_signature: ActorCallLoader.onStartLoading()
focal_class.full_signature: @Override protected void onStartLoading()
focal_class.identifier: onStartLoading
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onStartLoading()
focal_class.class_method_signature: ActorCallLoader.onForceLoad()
focal_class.full_signature: @Override protected void onForceLoad()
focal_class.identifier: onForceLoad
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onForceLoad()
focal_class.class_method_signature: ActorCallLoader.onReset()
focal_class.full_signature: @Override protected void onReset()
focal_class.identifier: onReset
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onReset()
focal_class.class_method_signature: ActorCallLoader.doLoad()
focal_class.full_signature: private void doLoad()
focal_class.identifier: doLoad
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void doLoad()
focal_class.class_method_signature: ActorCallLoader.cleanUp(@NonNull R result)
focal_class.full_signature: protected void cleanUp(@NonNull R result)
focal_class.identifier: cleanUp
focal_class.modifiers: protected
focal_class.parameters: (@NonNull R result)
focal_class.return: void
focal_class.signature: void cleanUp(@NonNull R result)
focal_class.class_method_signature: ActorCallLoader.doCall(@NonNull ActorRef<A> ref)
focal_class.full_signature: protected abstract Promise<R> doCall(@NonNull ActorRef<A> ref)
focal_class.identifier: doCall
focal_class.modifiers: protected abstract
focal_class.parameters: (@NonNull ActorRef<A> ref)
focal_class.return: Promise<R>
focal_class.signature: Promise<R> doCall(@NonNull ActorRef<A> ref)
focal_class.superclass: extends Loader<R>
focal_method.body: @Override
      protected void onStartLoading() {
          if (mState == STATE_CALLING) {
              // Will call listeners when it will be done
              return;
          }
  
          if (mState == STATE_DONE) {
              deliverResult(mResult);
              return;
          }
  
          doLoad();
      }
focal_method.class_method_signature: ActorCallLoader.onStartLoading()
focal_method.full_signature: @Override protected void onStartLoading()
focal_method.identifier: onStartLoading
focal_method.invocations: deliverResult doLoad
focal_method.modifiers: @Override protected
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void onStartLoading()