Skip to content

Commit

Permalink
fix: Return correct name from FlagdProvider (#126)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Drenski <[email protected]>
  • Loading branch information
austindrenski authored Jan 9, 2024
1 parent e3d0f06 commit 0b704e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/OpenFeature.Contrib.Providers.Flagd/FlagdProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ namespace OpenFeature.Contrib.Providers.Flagd
/// </summary>
public sealed class FlagdProvider : FeatureProvider
{
const string ProviderName = "flagd Provider";
static int EventStreamRetryBaseBackoff = 1;
private readonly FlagdConfig _config;
private readonly Service.ServiceClient _client;
private readonly Metadata _providerMetadata = new Metadata("flagd Provider");
private readonly Metadata _providerMetadata = new Metadata(ProviderName);

private readonly ICache<string, object> _cache;
private int _eventStreamRetries;
Expand Down Expand Up @@ -121,7 +122,7 @@ internal FlagdProvider(Service.ServiceClient client, FlagdConfig config, ICache<
/// </summary>
public static string GetProviderName()
{
return Api.Instance.GetProviderMetadata().Name;
return ProviderName;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void BuildClientForPlatform_Should_Throw_Exception_For_Unsupported_DotNet
[Fact]
public void TestGetProviderName()
{
Assert.Equal("No-op Provider", FlagdProvider.GetProviderName());
Assert.Equal("flagd Provider", FlagdProvider.GetProviderName());
}

[Fact]
Expand Down

0 comments on commit 0b704e9

Please sign in to comment.