Skip to content

Commit a2b7681

Browse files
authored
Config V3 - Beta Release (#648)
1 parent cb3063f commit a2b7681

File tree

83 files changed

+2243
-977
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2243
-977
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ dependencies {
8989
testImplementation("org.junit.jupiter:junit-jupiter:5.11.3")
9090
testImplementation("org.mockito:mockito-junit-jupiter:5.11.0")
9191
testImplementation('org.hamcrest:hamcrest:3.0')
92+
testImplementation('org.assertj:assertj-core:3.27.6')
9293
testImplementation('io.rest-assured:rest-assured:5.5.0')
9394
testImplementation('org.reflections:reflections:0.10.2')
9495

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.mageddo.commons;
2+
3+
import java.util.Collection;
4+
import java.util.HashMap;
5+
import java.util.Map;
6+
import java.util.function.Function;
7+
import java.util.stream.Collectors;
8+
9+
import lombok.experimental.UtilityClass;
10+
11+
@UtilityClass
12+
public class Collections {
13+
public static <T, R> Map<R, T> keyBy(Collection<T> c, Function<T, R> fn) {
14+
if (c == null) {
15+
return null;
16+
}
17+
if (c.isEmpty()) {
18+
return new HashMap<>();
19+
}
20+
return c.stream()
21+
.collect(Collectors.toMap(fn, Function.identity()));
22+
}
23+
}

src/main/java/com/mageddo/dnsproxyserver/config/CanaryRateThresholdCircuitBreakerStrategyConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class CanaryRateThresholdCircuitBreakerStrategyConfig implements CircuitB
1212
private int permittedNumberOfCallsInHalfOpenState;
1313

1414
@Override
15-
public Name name() {
16-
return Name.CANARY_RATE_THRESHOLD;
15+
public Type getType() {
16+
return Type.CANARY_RATE_THRESHOLD;
1717
}
1818
}

src/main/java/com/mageddo/dnsproxyserver/config/CircuitBreakerStrategyConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
public interface CircuitBreakerStrategyConfig {
77

8-
Name name();
8+
Type getType();
99

10-
enum Name {
10+
enum Type {
1111
/**
1212
* @see CircuitBreakerDelegateStaticThresholdFailsafe
1313
*/

0 commit comments

Comments
 (0)