Skip to content

Commit a7b01f6

Browse files
committed
update deps
1 parent cca662c commit a7b01f6

File tree

8 files changed

+51
-88
lines changed

8 files changed

+51
-88
lines changed

pmd.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
<rule ref="category/java/errorprone.xml/IdempotentOperations" />
9494
<rule ref="category/java/errorprone.xml/ImportFromSamePackage" />
9595
<rule ref="category/java/errorprone.xml/InstantiationToGetClass" />
96-
<rule ref="category/java/errorprone.xml/InvalidSlf4jMessageFormat" />
96+
<rule ref="category/java/errorprone.xml/InvalidLogMessageFormat" />
9797
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass" />
9898
<rule ref="category/java/errorprone.xml/StringBufferInstantiationWithChar" />
9999
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement" />

pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@
5656
<dependency>
5757
<groupId>com.fasterxml.jackson.core</groupId>
5858
<artifactId>jackson-databind</artifactId>
59-
<version>2.10.0</version>
59+
<version>2.10.3</version>
6060
</dependency>
6161
<dependency>
6262
<groupId>junit</groupId>
6363
<artifactId>junit</artifactId>
64-
<version>4.12</version>
64+
<version>4.13</version>
6565
<scope>test</scope>
6666
</dependency>
6767
<dependency>
6868
<groupId>com.squareup.okhttp3</groupId>
6969
<artifactId>mockwebserver</artifactId>
70-
<version>4.2.2</version>
70+
<version>4.4.1</version>
7171
<scope>test</scope>
7272
</dependency>
7373
</dependencies>
@@ -91,7 +91,7 @@
9191
<plugin>
9292
<groupId>org.apache.maven.plugins</groupId>
9393
<artifactId>maven-jar-plugin</artifactId>
94-
<version>3.1.2</version>
94+
<version>3.2.0</version>
9595
<configuration>
9696
<archive>
9797
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
@@ -101,12 +101,12 @@
101101
<plugin>
102102
<groupId>org.apache.maven.plugins</groupId>
103103
<artifactId>maven-checkstyle-plugin</artifactId>
104-
<version>3.1.0</version>
104+
<version>3.1.1</version>
105105
<dependencies>
106106
<dependency>
107107
<groupId>com.puppycrawl.tools</groupId>
108108
<artifactId>checkstyle</artifactId>
109-
<version>8.25</version>
109+
<version>8.30</version>
110110
</dependency>
111111
</dependencies>
112112
</plugin>
@@ -174,7 +174,7 @@
174174
<plugin>
175175
<groupId>org.apache.maven.plugins</groupId>
176176
<artifactId>maven-source-plugin</artifactId>
177-
<version>3.1.0</version>
177+
<version>3.2.1</version>
178178
<executions>
179179
<execution>
180180
<id>attach-sources</id>
@@ -227,7 +227,7 @@
227227
<plugin>
228228
<groupId>org.apache.maven.plugins</groupId>
229229
<artifactId>maven-pmd-plugin</artifactId>
230-
<version>3.12.0</version>
230+
<version>3.13.0</version>
231231
<dependencies>
232232
<dependency>
233233
<groupId>net.sourceforge.pmd</groupId>
@@ -273,7 +273,7 @@
273273

274274
<properties>
275275
<java.release>7</java.release>
276-
<pmdVersion>6.17.0</pmdVersion>
276+
<pmdVersion>6.22.0</pmdVersion>
277277
</properties>
278278

279279
<profiles>

scribejava-apis/src/test/java/com/github/scribejava/apis/fitbit/FitBitJsonTokenExtractorTest.java

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,34 @@
44
import com.github.scribejava.core.oauth2.OAuth2Error;
55
import java.io.IOException;
66

7-
import org.hamcrest.FeatureMatcher;
8-
import org.junit.Rule;
97
import org.junit.Test;
10-
import org.junit.rules.ExpectedException;
118

12-
import static org.hamcrest.CoreMatchers.equalTo;
9+
import static org.junit.Assert.assertThrows;
10+
import static org.junit.Assert.assertSame;
11+
import static org.junit.Assert.assertEquals;
12+
import org.junit.function.ThrowingRunnable;
1313

1414
public class FitBitJsonTokenExtractorTest {
1515

16-
private static final String ERROR_DESCRIPTION = "Authorization code invalid: " +
17-
"cbb1c11b23209011e89be71201fa6381464dc0af " +
18-
"Visit https://dev.fitbit.com/docs/oauth2 for more information " +
19-
"on the Fitbit Web API authorization process.";
20-
private static final String ERROR_JSON = "{\"errors\":[{\"errorType\":\"invalid_grant\",\"message\":\"" +
21-
ERROR_DESCRIPTION + "\"}],\"success\":false}";
22-
23-
@Rule
24-
public ExpectedException thrown = ExpectedException.none();
16+
private static final String ERROR_DESCRIPTION = "Authorization code invalid: "
17+
+ "cbb1c11b23209011e89be71201fa6381464dc0af "
18+
+ "Visit https://dev.fitbit.com/docs/oauth2 for more information "
19+
+ "on the Fitbit Web API authorization process.";
20+
private static final String ERROR_JSON = "{\"errors\":[{\"errorType\":\"invalid_grant\",\"message\":\""
21+
+ ERROR_DESCRIPTION + "\"}],\"success\":false}";
2522

2623
@Test
2724
public void testErrorExtraction() throws IOException {
2825

2926
final FitBitJsonTokenExtractor extractor = new FitBitJsonTokenExtractor();
30-
31-
thrown.expect(OAuth2AccessTokenErrorResponse.class);
32-
thrown.expect(new ErrorCodeFeatureMatcher(OAuth2Error.INVALID_GRANT));
33-
thrown.expect(new ErrorDescriptionFeatureMatcher(ERROR_DESCRIPTION));
34-
35-
extractor.generateError(ERROR_JSON);
36-
}
37-
38-
private static class ErrorCodeFeatureMatcher extends FeatureMatcher<OAuth2AccessTokenErrorResponse, OAuth2Error> {
39-
40-
private ErrorCodeFeatureMatcher(OAuth2Error expected) {
41-
super(equalTo(expected), "a response with errorCode", "errorCode");
42-
}
43-
44-
@Override
45-
protected OAuth2Error featureValueOf(OAuth2AccessTokenErrorResponse actual) {
46-
return actual.getError();
47-
}
48-
}
49-
50-
private static class ErrorDescriptionFeatureMatcher extends FeatureMatcher<OAuth2AccessTokenErrorResponse, String> {
51-
52-
private ErrorDescriptionFeatureMatcher(String expected) {
53-
super(equalTo(expected), "a response with errorDescription", "errorDescription");
54-
}
55-
56-
@Override
57-
protected String featureValueOf(OAuth2AccessTokenErrorResponse actual) {
58-
return actual.getErrorDescription();
59-
}
27+
final OAuth2AccessTokenErrorResponse thrown = assertThrows(OAuth2AccessTokenErrorResponse.class,
28+
new ThrowingRunnable() {
29+
@Override
30+
public void run() throws Throwable {
31+
extractor.generateError(ERROR_JSON);
32+
}
33+
});
34+
assertSame(OAuth2Error.INVALID_GRANT, thrown.getError());
35+
assertEquals(ERROR_DESCRIPTION, thrown.getErrorDescription());
6036
}
6137
}

scribejava-core/src/main/java/com/github/scribejava/core/httpclient/multipart/MultipartPayload.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private static Map<String, String> composeHeaders(String subtype, String boundar
7777

7878
static void checkBoundarySyntax(String boundary) {
7979
if (boundary == null || !BOUNDARY_REGEXP.matcher(boundary).matches()) {
80-
throw new IllegalArgumentException("{'boundary'='" + boundary + "'} has invaid syntax. Should be '"
80+
throw new IllegalArgumentException("{'boundary'='" + boundary + "'} has invalid syntax. Should be '"
8181
+ BOUNDARY_PATTERN + "'.");
8282
}
8383
}

scribejava-core/src/test/java/com/github/scribejava/core/httpclient/multipart/MultipartPayloadTest.java

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
package com.github.scribejava.core.httpclient.multipart;
22

3-
import org.hamcrest.core.StringStartsWith;
43
import static org.junit.Assert.assertEquals;
54
import static org.junit.Assert.assertNull;
6-
import org.junit.Rule;
5+
import static org.junit.Assert.assertThrows;
6+
import static org.junit.Assert.assertTrue;
77
import org.junit.Test;
8-
import org.junit.rules.ExpectedException;
8+
import org.junit.function.ThrowingRunnable;
99

1010
public class MultipartPayloadTest {
1111

12-
@Rule
13-
public ExpectedException thrown = ExpectedException.none();
14-
1512
@Test
1613
public void testValidCheckBoundarySyntax() {
1714
MultipartPayload.checkBoundarySyntax("0aA'()+_,-./:=?");
@@ -22,47 +19,27 @@ public void testValidCheckBoundarySyntax() {
2219

2320
@Test
2421
public void testNonValidLastWhiteSpaceCheckBoundarySyntax() {
25-
final String boundary = "0aA'()+_,-./:=? ";
26-
thrown.expect(IllegalArgumentException.class);
27-
thrown.expectMessage(
28-
StringStartsWith.startsWith("{'boundary'='" + boundary + "'} has invaid syntax. Should be '"));
29-
MultipartPayload.checkBoundarySyntax(boundary);
22+
testBoundary("0aA'()+_,-./:=? ");
3023
}
3124

3225
@Test
3326
public void testNonValidEmptyCheckBoundarySyntax() {
34-
final String boundary = "";
35-
thrown.expect(IllegalArgumentException.class);
36-
thrown.expectMessage(
37-
StringStartsWith.startsWith("{'boundary'='" + boundary + "'} has invaid syntax. Should be '"));
38-
MultipartPayload.checkBoundarySyntax(boundary);
27+
testBoundary("");
3928
}
4029

4130
@Test
4231
public void testNonValidIllegalSymbolCheckBoundarySyntax() {
43-
final String boundary = "0aA'()+_;,-./:=? ";
44-
thrown.expect(IllegalArgumentException.class);
45-
thrown.expectMessage(
46-
StringStartsWith.startsWith("{'boundary'='" + boundary + "'} has invaid syntax. Should be '"));
47-
MultipartPayload.checkBoundarySyntax(boundary);
32+
testBoundary("0aA'()+_;,-./:=? ");
4833
}
4934

5035
@Test
5136
public void testNonValidTooLongCheckBoundarySyntax() {
52-
final String boundary = "12345678901234567890123456789012345678901234567890123456789012345678901";
53-
thrown.expect(IllegalArgumentException.class);
54-
thrown.expectMessage(
55-
StringStartsWith.startsWith("{'boundary'='" + boundary + "'} has invaid syntax. Should be '"));
56-
MultipartPayload.checkBoundarySyntax(boundary);
37+
testBoundary("12345678901234567890123456789012345678901234567890123456789012345678901");
5738
}
5839

5940
@Test
6041
public void testNonValidNullCheckBoundarySyntax() {
61-
final String boundary = null;
62-
thrown.expect(IllegalArgumentException.class);
63-
thrown.expectMessage(
64-
StringStartsWith.startsWith("{'boundary'='" + boundary + "'} has invaid syntax. Should be '"));
65-
MultipartPayload.checkBoundarySyntax(boundary);
42+
testBoundary(null);
6643
}
6744

6845
@Test
@@ -118,4 +95,14 @@ public void testParseBoundaryFromHeader() {
11895
assertNull(MultipartPayload.parseBoundaryFromHeader("multipart/subtype; boundary=;123"));
11996
assertNull(MultipartPayload.parseBoundaryFromHeader("multipart/subtype; boundary=\"\"123"));
12097
}
98+
99+
private static void testBoundary(final String boundary) {
100+
final IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, new ThrowingRunnable() {
101+
@Override
102+
public void run() throws Throwable {
103+
MultipartPayload.checkBoundarySyntax(boundary);
104+
}
105+
});
106+
assertTrue(thrown.getMessage().startsWith("{'boundary'='" + boundary + "'} has invalid syntax. Should be '"));
107+
}
121108
}

scribejava-httpclient-ahc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>org.asynchttpclient</groupId>
2525
<artifactId>async-http-client</artifactId>
26-
<version>2.10.3</version>
26+
<version>2.11.0</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>com.github.scribejava</groupId>

scribejava-httpclient-apache/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>org.apache.httpcomponents</groupId>
2525
<artifactId>httpclient</artifactId>
26-
<version>4.5.10</version>
26+
<version>4.5.12</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>org.apache.httpcomponents</groupId>

scribejava-httpclient-okhttp/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<dependency>
2424
<groupId>com.squareup.okhttp3</groupId>
2525
<artifactId>okhttp</artifactId>
26-
<version>4.2.2</version>
26+
<version>4.4.1</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>com.github.scribejava</groupId>

0 commit comments

Comments
 (0)