Skip to content

Commit 9c2c8d5

Browse files
committed
Remove integration test and associated CI/Maven scaffolding
The MockWebServer-based integration test added too much complexity (reflection hacks, test cert setup, extra dependencies) for little value over the existing unit tests. This reverts commits a481565, 50405c5, 63376d6, and 341b367: - Delete HttpRateLimitRetryIntegrationIT - Remove mockwebserver and okhttp-tls test dependencies - Remove maven-failsafe-plugin configuration - Revert CI from mvn verify back to mvn test - Restore testDefaultMaxBackoffIsUsedWhenNotSpecified unit test
1 parent a481565 commit 9c2c8d5

4 files changed

Lines changed: 12 additions & 164 deletions

File tree

.github/workflows/java-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
--file duo-client/pom.xml
3434
- name: Test with Maven
3535
run: >
36-
mvn verify
36+
mvn test
3737
--batch-mode
3838
-file duo-client/pom.xml
3939
- name: Lint with checkstyle

duo-client/pom.xml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,6 @@
6565
<version>3.12.4</version>
6666
<scope>test</scope>
6767
</dependency>
68-
<dependency>
69-
<groupId>com.squareup.okhttp3</groupId>
70-
<artifactId>mockwebserver</artifactId>
71-
<version>4.12.0</version>
72-
<scope>test</scope>
73-
</dependency>
74-
<dependency>
75-
<groupId>com.squareup.okhttp3</groupId>
76-
<artifactId>okhttp-tls</artifactId>
77-
<version>4.12.0</version>
78-
<scope>test</scope>
79-
</dependency>
8068
</dependencies>
8169

8270
<build>
@@ -135,19 +123,6 @@
135123
<parallel>methods</parallel>
136124
</configuration>
137125
</plugin>
138-
<plugin>
139-
<groupId>org.apache.maven.plugins</groupId>
140-
<artifactId>maven-failsafe-plugin</artifactId>
141-
<version>3.2.5</version>
142-
<executions>
143-
<execution>
144-
<goals>
145-
<goal>integration-test</goal>
146-
<goal>verify</goal>
147-
</goals>
148-
</execution>
149-
</executions>
150-
</plugin>
151126
<plugin>
152127
<groupId>org.cyclonedx</groupId>
153128
<artifactId>cyclonedx-maven-plugin</artifactId>

duo-client/src/test/java/com/duosecurity/client/HttpRateLimitRetryIntegrationIT.java

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

duo-client/src/test/java/com/duosecurity/client/HttpRateLimitRetryTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,17 @@ public Call answer(InvocationOnMock invocationOnMock) throws Throwable {
209209
assertEquals(4000L + RANDOM_INT, (long) sleepTimes.get(2));
210210
}
211211

212+
@Test
213+
public void testDefaultMaxBackoffIsUsedWhenNotSpecified() throws Exception {
214+
Http defaultHttp = new Http.HttpBuilder("GET", "example.test", "/foo/bar").build();
215+
216+
Field maxBackoffField = Http.class.getDeclaredField("maxBackoffMs");
217+
maxBackoffField.setAccessible(true);
218+
long actualMaxBackoff = (long) maxBackoffField.get(defaultHttp);
219+
220+
assertEquals(Http.MAX_BACKOFF_MS, actualMaxBackoff);
221+
}
222+
212223
@Test(expected = IllegalArgumentException.class)
213224
public void testMaxBackoffNegativeThrows() {
214225
new Http.HttpBuilder("GET", "example.test", "/foo/bar")

0 commit comments

Comments
 (0)