-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into make-provider-stateless
Signed-off-by: Todd Baert <[email protected]>
- Loading branch information
Showing
12 changed files
with
118 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/openfeature/sdk/exceptions/OpenFeatureErrorWithoutStacktrace.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dev.openfeature.sdk.exceptions; | ||
|
||
import lombok.experimental.StandardException; | ||
|
||
@SuppressWarnings("checkstyle:MissingJavadocType") | ||
@StandardException | ||
public abstract class OpenFeatureErrorWithoutStacktrace extends OpenFeatureError { | ||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
public synchronized Throwable fillInStackTrace() { | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/test/java/dev/openfeature/sdk/AlwaysBrokenWithDetailsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package dev.openfeature.sdk; | ||
|
||
import dev.openfeature.sdk.exceptions.FlagNotFoundError; | ||
|
||
public class AlwaysBrokenWithDetailsProvider implements FeatureProvider { | ||
|
||
@Override | ||
public Metadata getMetadata() { | ||
return () -> { | ||
throw new FlagNotFoundError(TestConstants.BROKEN_MESSAGE); | ||
}; | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Boolean> getBooleanEvaluation(String key, Boolean defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<Boolean>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<String> getStringEvaluation(String key, String defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<String>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<Integer>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Double> getDoubleEvaluation(String key, Double defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<Double>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Value> getObjectEvaluation(String key, Value defaultValue, EvaluationContext invocationContext) { | ||
return ProviderEvaluation.<Value>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters