Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import dev.openfeature.sdk.ProviderEvent;
import dev.openfeature.sdk.Reason;
import dev.openfeature.sdk.Value;
import dev.openfeature.sdk.exceptions.FlagNotFoundError;
import dev.openfeature.sdk.exceptions.GeneralError;
import dev.openfeature.sdk.exceptions.ParseError;
import dev.openfeature.sdk.exceptions.TypeMismatchError;
Expand Down Expand Up @@ -204,6 +205,12 @@ private <T> ProviderEvaluation<T> resolve(Class<T> type, String key, EvaluationC
// check variant existence
Object value = flag.getVariants().get(resolvedVariant);
if (value == null) {
if (resolvedVariant.isEmpty()) {
String message = String.format("no default variant found in flag with key %s", key);
log.debug(message);
throw new FlagNotFoundError(message);
}

String message = String.format("variant %s not found in flag with key %s", resolvedVariant, key);
log.debug(message);
throw new GeneralError(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "dev.openfeature.contrib.providers.flagd.e2e.steps")
@ConfigurationParameter(key = OBJECT_FACTORY_PROPERTY_NAME, value = "io.cucumber.picocontainer.PicoFactory")
@IncludeTags("in-process")
@ExcludeTags({"unixsocket", "targetURI", "no-default"})
@ExcludeTags({"unixsocket", "targetURI"})
@Testcontainers
@Isolated
public class RunInProcessTest {
Expand Down