Skip to content

Commit 7de08fb

Browse files
Copilotrpdome
andauthored
Delete duplicate ConcurrentAcquireTokenExecutor.java; align helper SCOPE_POOL with Kotlin counterpart
Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-android/sessions/0ff28edf-f07f-4479-974b-f790a095ce04 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com>
1 parent 186f41a commit 7de08fb

2 files changed

Lines changed: 25 additions & 308 deletions

File tree

msalautomationapp/src/androidTest/java/com/microsoft/identity/client/msal/automationapp/testpass/broker/concurrent/ConcurrentAcquireTokenSilentHelper.java

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
package com.microsoft.identity.client.msal.automationapp.testpass.broker.concurrent;
2424

2525
import java.util.ArrayList;
26-
import java.util.Arrays;
2726
import java.util.Collections;
2827
import java.util.List;
2928
import java.util.concurrent.CountDownLatch;
@@ -41,9 +40,9 @@
4140
* call per (thread, iteration) slot; the helper manages thread creation,
4241
* synchronization, error collection, and timeout enforcement.</p>
4342
*
44-
* <p>The scope pool ({@link #THREAD_SCOPES}) mirrors the design used in the
43+
* <p>The scope pool ({@link #SCOPE_POOL}) mirrors the design used in the
4544
* msaltestapp's {@code ConcurrentAcquireTokenExecutor}: each thread is
46-
* assigned a distinct scope set so that the MSAL {@code CommandDispatcher}
45+
* assigned a distinct scope so that the MSAL {@code CommandDispatcher}
4746
* cannot collapse concurrent in-flight requests that would otherwise be
4847
* identical.</p>
4948
*/
@@ -52,37 +51,37 @@ public final class ConcurrentAcquireTokenSilentHelper {
5251
private ConcurrentAcquireTokenSilentHelper() { /* utility class */ }
5352

5453
/**
55-
* Scope combinations rotated per-thread to prevent the
56-
* {@code CommandDispatcher} from deduplicating concurrent requests that
57-
* share identical parameters.
54+
* Scopes rotated per-thread to prevent the {@code CommandDispatcher}
55+
* from deduplicating concurrent requests that share identical parameters.
5856
*
59-
* <p>The array contains exactly 13 entries, matching the default value of
60-
* the {@code concurrent_count} field in the msaltestapp UI.</p>
57+
* <p>Matches the {@code SCOPE_POOL} used in the msaltestapp's
58+
* {@code ConcurrentAcquireTokenExecutor.kt}, with 13 entries to cover
59+
* the default {@code concurrent_count} value in the msaltestapp UI.</p>
6160
*/
62-
public static final String[][] THREAD_SCOPES = {
63-
{"User.read"},
64-
{"User.read", "profile"},
65-
{"User.read", "openid"},
66-
{"User.read", "email"},
67-
{"User.read", "offline_access"},
68-
{"User.read", "profile", "openid"},
69-
{"User.read", "profile", "email"},
70-
{"User.read", "openid", "email"},
71-
{"User.read", "openid", "offline_access"},
72-
{"User.read", "email", "offline_access"},
73-
{"User.read", "profile", "openid", "email"},
74-
{"User.read", "profile", "offline_access"},
75-
{"User.read", "openid", "email", "offline_access"}
61+
public static final String[] SCOPE_POOL = {
62+
"user.read",
63+
"user.readbasic.all",
64+
"mail.read",
65+
"calendars.read",
66+
"contacts.read",
67+
"files.read",
68+
"files.read.all",
69+
"people.read",
70+
"notes.read",
71+
"tasks.read",
72+
"sites.read.all",
73+
"directory.read.all",
74+
"group.read.all"
7675
};
7776

7877
/**
79-
* Returns a mutable {@link List} of scopes assigned to {@code threadIndex},
80-
* cycling through {@link #THREAD_SCOPES} when
81-
* {@code threadIndex >= THREAD_SCOPES.length}.
78+
* Returns a mutable {@link List} containing the single scope assigned to
79+
* {@code threadIndex}, cycling through {@link #SCOPE_POOL} when
80+
* {@code threadIndex >= SCOPE_POOL.length}.
8281
*/
8382
public static List<String> scopesForThread(final int threadIndex) {
8483
return new ArrayList<>(
85-
Arrays.asList(THREAD_SCOPES[threadIndex % THREAD_SCOPES.length]));
84+
Collections.singletonList(SCOPE_POOL[threadIndex % SCOPE_POOL.length]));
8685
}
8786

8887
// -------------------------------------------------------------------------

testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/ConcurrentAcquireTokenExecutor.java

Lines changed: 0 additions & 282 deletions
This file was deleted.

0 commit comments

Comments
 (0)