Skip to content

Commit 11aee2c

Browse files
authored
Merge pull request #80 from AzureAD/sagonzal/warnings
Remove use of deprecated API. Suppress test warning
2 parents ed3bfbf + ade9440 commit 11aee2c

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
</dependency>
5656
<dependency>
5757
<groupId>org.apache.commons</groupId>
58-
<artifactId>commons-lang3</artifactId>
59-
<version>3.9</version>
58+
<artifactId>commons-text</artifactId>
59+
<version>1.7</version>
6060
</dependency>
6161
<dependency>
6262
<groupId>org.projectlombok</groupId>
@@ -98,7 +98,7 @@
9898
<dependency>
9999
<groupId>org.apache.httpcomponents</groupId>
100100
<artifactId>httpclient</artifactId>
101-
<version>4.5</version>
101+
<version>4.5.9</version>
102102
</dependency>
103103
<dependency>
104104
<groupId>com.microsoft.azure</groupId>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
package com.microsoft.aad.msal4j;
55

6-
import org.apache.commons.lang3.StringEscapeUtils;
7-
import org.apache.commons.lang3.StringUtils;
6+
import org.apache.commons.text.StringEscapeUtils;
87
import org.slf4j.Logger;
98
import org.slf4j.LoggerFactory;
109

@@ -189,7 +188,7 @@ static StringBuilder buildMessage(String address, String username,
189188
guid, address,
190189
integrated ? "" : securityHeaderBuilder.toString(),
191190
rstTrustNamespace,
192-
StringUtils.isNotEmpty(cloudAudienceUrn) ? cloudAudienceUrn : DEFAULT_APPLIES_TO,
191+
StringHelper.isBlank(cloudAudienceUrn) ? DEFAULT_APPLIES_TO : cloudAudienceUrn,
193192
keyType,
194193
requestType));
195194

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public static Map<String, String> getQueryMap(String query)
5858
" \"message\": \"To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code DW83JNP2P to authenticate.\"\n" +
5959
"}";
6060

61+
@SuppressWarnings("unchecked")
6162
@Test
6263
public void deviceCodeFlowTest() throws Exception {
6364
app = PowerMock.createPartialMock(PublicClientApplication.class,
@@ -137,7 +138,7 @@ public void deviceCodeFlowTest() throws Exception {
137138
Map<String, String> expectedQueryParams = new HashMap<>();
138139
expectedQueryParams.put("client_id", AAD_CLIENT_ID);
139140
expectedQueryParams.put("scope", URLEncoder.encode(AbstractMsalAuthorizationGrant.COMMON_SCOPES_PARAM +
140-
AbstractMsalAuthorizationGrant.SCOPES_DELIMITER + AAD_RESOURCE_ID));
141+
AbstractMsalAuthorizationGrant.SCOPES_DELIMITER + AAD_RESOURCE_ID, "UTF-8" ));
141142

142143
Assert.assertEquals(getQueryMap(url.getQuery()), expectedQueryParams);
143144

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public void oAuthRequest_for_acquireTokenByUserAssertion() throws Exception {
176176
Assert.assertEquals(CLIENT_INFO_VALUE, queryParams.get("client_info"));
177177
}
178178

179+
@SuppressWarnings("unchecked")
179180
@Test
180181
public void oAuthRequest_for_acquireTokenByAsymmetricKeyCredential() throws Exception {
181182
PowerMock.mockStatic(HttpHelper.class);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public class PublicClientApplicationTest extends PowerMockTestCase {
2424

2525
private PublicClientApplication app = null;
2626

27+
@SuppressWarnings("unchecked")
28+
@Test
2729
public void testAcquireToken_Username_Password() throws Exception {
2830
app = PowerMock.createPartialMock(PublicClientApplication.class,
2931
new String[] { "acquireTokenCommon" },

0 commit comments

Comments
 (0)