Skip to content

Commit

Permalink
Remove obsolete testing framework
Browse files Browse the repository at this point in the history
  • Loading branch information
velo committed Dec 11, 2023
1 parent 97f78b2 commit c3eb0bf
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 86 deletions.
6 changes: 0 additions & 6 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions core/src/test/java/feign/AsyncFeignTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.params.provider.ValueSource;
import org.junit.rules.ExpectedException;

public class AsyncFeignTest {
Expand Down Expand Up @@ -671,7 +670,7 @@ public void whenReturnTypeIsResponseNoErrorHandling() throws Throwable {

@Ignore("FIXME random test failures when building on ubuntu, need to investigate further")
// @ParameterizedTest
@ValueSource(ints = {1, 5, 10, 100, 1000})
// @ValueSource(ints = {1, 5, 10, 100, 1000})
public void cancelRetry(final int expectedTryCount) throws Throwable {
// Arrange
final CompletableFuture<Boolean> maximumTryCompleted = new CompletableFuture<>();
Expand Down
1 change: 0 additions & 1 deletion core/src/test/java/feign/FeignTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import static feign.assertj.MockWebServerAssertions.assertThat;
import static java.util.Collections.emptyList;
import static junit.framework.TestCase.assertNotNull;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
import static org.assertj.core.data.MapEntry.entry;
Expand Down
5 changes: 0 additions & 5 deletions dropwizard-metrics4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
<artifactId>metrics-core</artifactId>
<version>4.2.22</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-micrometer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@
*/
package feign.metrics4;

import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString;
import java.util.Arrays;
import java.util.Map;
import java.util.Map.Entry;
import com.codahale.metrics.Metered;
import com.codahale.metrics.Metric;
import com.codahale.metrics.MetricRegistry;
import feign.Capability;
import feign.Util;
import feign.micrometer.AbstractMetricsTestBase;
import java.util.Arrays;
import java.util.Map;
import java.util.Map.Entry;
import org.hamcrest.Matcher;

public class Metrics4CapabilityTest
extends AbstractMetricsTestBase<MetricRegistry, String, Metric> {
Expand All @@ -46,9 +43,8 @@ protected Map<String, Metric> getFeignMetrics() {

@Override
protected boolean doesMetricIdIncludeClient(String metricId) {
Matcher<String> containsBase = containsString("feign.micrometer.AbstractMetricsTestBase$");
Matcher<String> containsSource = containsString("Source");
return allOf(containsBase, containsSource).matches(metricId);
return metricId.contains("feign.micrometer.AbstractMetricsTestBase$")
&& metricId.contains("Source");
}

@Override
Expand Down
5 changes: 0 additions & 5 deletions dropwizard-metrics5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
<artifactId>metrics-core</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-micrometer</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
*/
package feign.metrics5;

import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasEntry;
import feign.Capability;
import feign.Util;
import feign.micrometer.AbstractMetricsTestBase;
Expand Down Expand Up @@ -49,20 +46,20 @@ protected Map<MetricName, Metric> getFeignMetrics() {
@Override
protected boolean doesMetricIdIncludeClient(MetricName metricId) {
String tag = metricId.getTags().get("client");
Matcher<String> containsBase = containsString("feign.micrometer.AbstractMetricsTestBase$");
Matcher<String> containsSource = containsString("Source");
return allOf(containsBase, containsSource).matches(tag);
return tag.contains("feign.micrometer.AbstractMetricsTestBase$") && tag.contains("Source");
}

@Override
protected boolean doesMetricIncludeVerb(MetricName metricId, String verb) {
return hasEntry("method", verb).matches(metricId.getTags());
String entry = metricId.getTags().get("method");
return entry != null && entry.equals(verb);
}

@Override
protected boolean doesMetricIncludeHost(MetricName metricId) {
// hostname is null due to feign-mock shortfalls
return hasEntry("host", null).matches(metricId.getTags());
String entry = metricId.getTags().get("host");
return entry == null;
}

@Override
Expand Down
5 changes: 0 additions & 5 deletions jaxrs2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,5 @@
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
5 changes: 0 additions & 5 deletions json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions micrometer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
<version>${micrometer.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>feign-okhttp</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions mock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
<artifactId>feign-gson</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
9 changes: 2 additions & 7 deletions mock/src/test/java/feign/mock/RequestKeyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
package feign.mock;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -146,17 +143,15 @@ public void equalsExtendedExtra() {
@Test
public void testToString() throws Exception {
assertThat(requestKey.toString()).startsWith("Request [GET a: ");
assertThat(requestKey.toString(),
both(containsString(" with my-header=[val] ")).and(containsString(" UTF-16]")));
assertThat(requestKey.toString()).contains(" with my-header=[val] ", " UTF-16]");
}

@Test
public void testToStringSimple() throws Exception {
requestKey = RequestKey.builder(HttpMethod.GET, "a").build();

assertThat(requestKey.toString()).startsWith("Request [GET a: ");
assertThat(requestKey.toString(),
both(containsString(" without ")).and(containsString(" no charset")));
assertThat(requestKey.toString()).contains(" without ", " no charset");
}

}
Expand Down
22 changes: 4 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,9 @@
<slf4j.version>2.0.9</slf4j.version>
<json.version>20231013</json.version>

<junit.version>4.13.2</junit.version>
<junit5.version>5.10.1</junit5.version>
<jackson.version>2.16.0</jackson.version>
<assertj.version>3.24.2</assertj.version>
<hamcrest.version>2.2</hamcrest.version>
<mockito.version>5.7.0</mockito.version>

<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
Expand Down Expand Up @@ -287,11 +285,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
Expand All @@ -300,12 +293,6 @@
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>${hamcrest.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down Expand Up @@ -391,14 +378,13 @@

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>

Expand Down
5 changes: 0 additions & 5 deletions spring4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@
<artifactId>feign-jackson</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>

0 comments on commit c3eb0bf

Please sign in to comment.