Skip to content

Commit 23589dd

Browse files
committed
experimental using of local resolve
1 parent 7f891a9 commit 23589dd

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.spotify.confidence;
2+
3+
import java.lang.annotation.Documented;
4+
import java.lang.annotation.ElementType;
5+
import java.lang.annotation.Retention;
6+
import java.lang.annotation.RetentionPolicy;
7+
import java.lang.annotation.Target;
8+
9+
@Documented
10+
@Retention(RetentionPolicy.RUNTIME)
11+
@Target(ElementType.TYPE)
12+
public @interface Experimental {
13+
String value() default
14+
"This class is experimental and not stable,"
15+
+ " please avoid using it before talking to the confidence team.";
16+
}

openfeature-provider-local/src/main/java/com/spotify/confidence/OpenFeatureLocalResolveProvider.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,16 @@
1818
import java.util.function.Function;
1919
import org.slf4j.Logger;
2020

21+
@Experimental
2122
public class OpenFeatureLocalResolveProvider implements FeatureProvider {
2223
private final String clientSecret;
23-
private final ApiSecret apiSecret;
2424
private static final Logger log =
2525
org.slf4j.LoggerFactory.getLogger(OpenFeatureLocalResolveProvider.class);
26-
private FlagResolverService flagResolverService;
26+
private final FlagResolverService flagResolverService;
2727

2828
public OpenFeatureLocalResolveProvider(ApiSecret apiSecret, String clientSecret) {
29-
this.apiSecret = apiSecret;
30-
this.clientSecret = clientSecret;
31-
}
32-
33-
@Override
34-
public void initialize(EvaluationContext evaluationContext) throws Exception {
3529
this.flagResolverService = LocalResolverServiceFactory.from(apiSecret, clientSecret);
36-
FeatureProvider.super.initialize(evaluationContext);
30+
this.clientSecret = clientSecret;
3731
}
3832

3933
@Override

openfeature-provider-local/src/test/java/com/spotify/confidence/AssignLoggerTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class AssignLoggerTest {
3535

3636
@BeforeEach
3737
public void beforeEach() {
38-
3938
stub = mock(InternalFlagLoggerServiceGrpc.InternalFlagLoggerServiceBlockingStub.class);
4039
logger = new AssignLogger(stub, null, new MetricRegistry(), 8 * 1024 * 1024);
4140
}

0 commit comments

Comments
 (0)