Ensure the mock Call state is set to HOLD before evaluation to remove potential race conditions

Bug: 332857946
Test: atest TelecomUnitTests
Merged-In: Ic7ae1ca2892f071a5ab5d38fee46a95f060bbbd8
Change-Id: I4c8ed91abffeaf3ae3b013e8a782b714d377ecd7
diff --git a/tests/src/com/android/server/telecom/tests/TransactionTests.java b/tests/src/com/android/server/telecom/tests/TransactionTests.java
index e58c6c4..0f7fd48 100644
--- a/tests/src/com/android/server/telecom/tests/TransactionTests.java
+++ b/tests/src/com/android/server/telecom/tests/TransactionTests.java
@@ -310,8 +310,8 @@
 
         // simulate the transaction being processed and the setOnHold() being called / state change
         t.processTransaction(null);
-        t.getCallStateListenerImpl().onCallStateChanged(CallState.ON_HOLD);
         when(mMockCall1.getState()).thenReturn(CallState.ON_HOLD);
+        t.getCallStateListenerImpl().onCallStateChanged(CallState.ON_HOLD);
 
         // THEN
         verify(mMockCall1, times(1)).addCallStateListener(t.getCallStateListenerImpl());