Skip to content

Commit ff98a51

Browse files
author
wslaghekke
committed
Fix android test
1 parent 42890b1 commit ff98a51

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

android/src/test/java/nl/recognize/msauthplugin/MsAuthPluginTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
import com.getcapacitor.JSArray;
1616
import com.getcapacitor.JSObject;
1717
import com.getcapacitor.PluginCall;
18-
import com.microsoft.identity.client.IAccount;
19-
import com.microsoft.identity.client.IAuthenticationResult;
20-
import com.microsoft.identity.client.ISingleAccountPublicClientApplication;
18+
import com.microsoft.identity.client.*;
2119
import com.microsoft.identity.client.exception.MsalException;
2220
import java.io.File;
2321
import java.util.List;
@@ -103,6 +101,11 @@ void loginExpectAcquireTokenSilent() throws JSONException, MsalException, Interr
103101
ID_TOKEN,
104102
new String[] { "mocked-scope", "openid", "profile" }
105103
);
104+
ICurrentAccountResult currentAccountResult = new CurrentAccountResult(result.getAccount(), null, true);
105+
when(
106+
singleAccountPublicClientApplication.getCurrentAccount()
107+
).thenReturn(currentAccountResult);
108+
106109
when(
107110
singleAccountPublicClientApplication.acquireTokenSilent(
108111
argThat(

0 commit comments

Comments
 (0)