Skip to content

Commit 13d9870

Browse files
author
sgonzalezMSFT
committed
Merge branch 'dev' into sagonzal/addClientAssertion
1 parent 0cbf6af commit 13d9870

16 files changed

+36
-51
lines changed

src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void acquireTokenSilent_LabAuthority_TokenNotRefreshed() throws Exception
5656
String password = labUserProvider.getUserPassword(labResponse.getUser());
5757
String labAuthority = TestConstants.MICROSOFT_AUTHORITY_HOST + labResponse.getUser().getTenantId();
5858

59-
PublicClientApplication pca = new PublicClientApplication.Builder(
59+
PublicClientApplication pca = PublicClientApplication.builder(
6060
labResponse.getAppId()).
6161
authority(labAuthority).
6262
build();
@@ -90,7 +90,7 @@ public void acquireTokenSilent_ForceRefresh() throws Exception {
9090
false);
9191
String password = labUserProvider.getUserPassword(labResponse.getUser());
9292

93-
PublicClientApplication pca = new PublicClientApplication.Builder(
93+
PublicClientApplication pca = PublicClientApplication.builder(
9494
labResponse.getAppId()).
9595
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
9696
build();
@@ -167,11 +167,9 @@ public void acquireTokenSilent_usingTenantSpecificAuthority_returnCachedAt() thr
167167
NationalCloud.AZURE_CLOUD,
168168
false);
169169
String tenantSpecificAuthority = TestConstants.MICROSOFT_AUTHORITY_HOST + labResponse.getUser().getTenantId();
170-
171170
acquireTokenSilent_returnCachedTokens(tenantSpecificAuthority);
172171
}
173172

174-
175173
@Test
176174
public void acquireTokenSilent_ConfidentialClient_acquireTokenSilent() throws Exception{
177175

@@ -236,7 +234,7 @@ private void acquireTokenSilent_returnCachedTokens(String authority) throws Exce
236234
false);
237235
String password = labUserProvider.getUserPassword(labResponse.getUser());
238236

239-
PublicClientApplication pca = new PublicClientApplication.Builder(
237+
PublicClientApplication pca = PublicClientApplication.builder(
240238
labResponse.getAppId()).
241239
authority(authority).
242240
build();
@@ -267,7 +265,7 @@ private IPublicClientApplication getPublicClientApplicationWithTokensInCache()
267265
false);
268266
String password = labUserProvider.getUserPassword(labResponse.getUser());
269267

270-
PublicClientApplication pca = new PublicClientApplication.Builder(
268+
PublicClientApplication pca = PublicClientApplication.builder(
271269
labResponse.getAppId()).
272270
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
273271
build();

src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void acquireTokenClientCredentials_ClientAssertion() throws Exception{
5959
}
6060

6161
private void assertAcquireTokenCommon(String clientId, IClientCredential credential) throws Exception{
62-
ConfidentialClientApplication cca = new ConfidentialClientApplication.Builder(
62+
ConfidentialClientApplication cca = ConfidentialClientApplication.builder(
6363
clientId, credential).
6464
authority(TestConstants.MICROSOFT_AUTHORITY).
6565
build();

src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void DeviceCodeFlowTest() throws Exception {
4242
false);
4343
labUserProvider.getUserPassword(labResponse.getUser());
4444

45-
PublicClientApplication pca = new PublicClientApplication.Builder(
45+
PublicClientApplication pca = PublicClientApplication.builder(
4646
labResponse.getAppId()).
4747
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
4848
build();

src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private void assertAcquireTokenCommon(NationalCloud cloud) throws Exception{
4141
false);
4242
String password = labUserProvider.getUserPassword(labResponse.getUser());
4343

44-
PublicClientApplication pca = new PublicClientApplication.Builder(
44+
PublicClientApplication pca = PublicClientApplication.builder(
4545
labResponse.getAppId()).
4646
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
4747
build();

src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void setUp() throws Exception {
2626
NationalCloud.AZURE_CLOUD,
2727
false);
2828
String password = labUserProvider.getUserPassword(labResponse.getUser());
29-
pca = new PublicClientApplication.Builder(
29+
pca = PublicClientApplication.builder(
3030
labResponse.getAppId()).
3131
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
3232
build();

src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void singleAccountInCache_RemoveAccountTest() throws Exception {
3030
false);
3131
String password = labUserProvider.getUserPassword(labResponse.getUser());
3232

33-
PublicClientApplication pca = new PublicClientApplication.Builder(
33+
PublicClientApplication pca = PublicClientApplication.builder(
3434
labResponse.getAppId()).
3535
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
3636
build();
@@ -62,7 +62,7 @@ public void twoAccountsInCache_RemoveAccountTest() throws Exception{
6262
false);
6363
String password = labUserProvider.getUserPassword(labResponse1.getUser());
6464

65-
PublicClientApplication pca = new PublicClientApplication.Builder(
65+
PublicClientApplication pca = PublicClientApplication.builder(
6666
labResponse1.getAppId()).
6767
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
6868
build();
@@ -125,7 +125,7 @@ public void twoAccountsInCache_SameUserDifferentTenants_RemoveAccountTest() thro
125125
ITokenCacheAccessAspect persistenceAspect = new TokenPersistence(dataToInitCache);
126126

127127
// acquire tokens for home tenant, and serialize cache
128-
PublicClientApplication pca = new PublicClientApplication.Builder(
128+
PublicClientApplication pca = PublicClientApplication.builder(
129129
labResponse.getAppId()).
130130
authority(TestConstants.ORGANIZATIONS_AUTHORITY)
131131
.setTokenCacheAccessAspect(persistenceAspect)
@@ -141,7 +141,7 @@ public void twoAccountsInCache_SameUserDifferentTenants_RemoveAccountTest() thro
141141
String guestTenantAuthority = TestConstants.MICROSOFT_AUTHORITY_HOST + labResponse.getUser().getTenantId();
142142

143143
// initialize pca with tenant where user is guest, deserialize cache, and acquire second token
144-
PublicClientApplication pca2 = new PublicClientApplication.Builder(
144+
PublicClientApplication pca2 = PublicClientApplication.builder(
145145
labResponse.getAppId()).
146146
authority(guestTenantAuthority).
147147
setTokenCacheAccessAspect(persistenceAspect).

src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void acquireTokenWithUsernamePassword_ADFSv2() throws Exception{
7575

7676
public void assertAcquireTokenCommon(LabResponse labResponse, String password)
7777
throws Exception{
78-
PublicClientApplication pca = new PublicClientApplication.Builder(
78+
PublicClientApplication pca = PublicClientApplication.builder(
7979
labResponse.getAppId()).
8080
authority(TestConstants.ORGANIZATIONS_AUTHORITY).
8181
build();
@@ -103,7 +103,7 @@ public void acquireTokenWithUsernamePassword_B2C_CustomAuthority() throws Except
103103
String b2CAppId = "e3b9ad76-9763-4827-b088-80c7a7888f79";
104104
String password = labUserProvider.getUserPassword(labResponse.getUser());
105105

106-
PublicClientApplication pca = new PublicClientApplication.Builder(
106+
PublicClientApplication pca = PublicClientApplication.builder(
107107
b2CAppId).
108108
b2cAuthority(TestConstants.B2C_AUTHORITY_ROPC).
109109
build();
@@ -129,7 +129,7 @@ public void acquireTokenWithUsernamePassword_B2C_LoginMicrosoftOnline() throws E
129129
String b2CAppId = "e3b9ad76-9763-4827-b088-80c7a7888f79";
130130
String password = labUserProvider.getUserPassword(labResponse.getUser());
131131

132-
PublicClientApplication pca = new PublicClientApplication.Builder(
132+
PublicClientApplication pca = PublicClientApplication.builder(
133133
b2CAppId).
134134
b2cAuthority(TestConstants.B2C_MICROSOFTLOGIN_ROPC).
135135
build();

src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,7 @@ public static class Builder extends ClientApplicationBase.Builder<Builder> {
111111

112112
private IClientCredential clientCredential;
113113

114-
/**
115-
* Constructor to create instance of Builder of ConfidentialClientApplication
116-
*
117-
* @param clientId Client ID (Application ID) of the application as registered
118-
* in the application registration portal (portal.azure.com)
119-
* @param clientCredential The client credential to use for token acquisition.
120-
*/
121-
Builder(String clientId, IClientCredential clientCredential) {
114+
private Builder(String clientId, IClientCredential clientCredential) {
122115
super(clientId);
123116
this.clientCredential = clientCredential;
124117
}

src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,7 @@ public static Builder builder(String clientId) {
9797

9898
public static class Builder extends ClientApplicationBase.Builder<Builder> {
9999

100-
/**
101-
* Constructor to create instance of Builder of PublicClientApplication
102-
*
103-
* @param clientId Client ID (Application ID) of the application as registered
104-
* in the application registration portal (portal.azure.com)
105-
*/
106-
Builder(String clientId) {
100+
private Builder(String clientId) {
107101
super(clientId);
108102
}
109103

src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public void tokenCacheEntitiesFormatTest(String folder) throws URISyntaxExceptio
126126

127127
String tokenResponse = getTokenResponse(folder);
128128

129-
PublicClientApplication app = new PublicClientApplication.Builder(CLIENT_ID).build();
129+
PublicClientApplication app = PublicClientApplication.builder(CLIENT_ID).build();
130130

131131
AuthorizationCodeParameters parameters =
132132
AuthorizationCodeParameters.builder

0 commit comments

Comments
 (0)