Skip to content

Commit

Permalink
Merge pull request #14 from flagship-io/get-flag-warning-log
Browse files Browse the repository at this point in the history
Get flag warning log
  • Loading branch information
Heihokon authored Aug 29, 2023
2 parents 50b4aee + 963f35f commit eb4342c
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 57 deletions.
26 changes: 13 additions & 13 deletions Flagship.Tests/Api/BatchingContinuousCachingStrategyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task AddTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var hitsPoolQueue = new Dictionary<string, HitAbstract>();
Expand Down Expand Up @@ -96,7 +96,7 @@ public async Task NotConsentTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var hitsPoolQueue = new Dictionary<string, HitAbstract>();
Expand Down Expand Up @@ -181,7 +181,7 @@ public async Task NotConsentEmptyTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var hitsPoolQueue = new Dictionary<string, HitAbstract>();
Expand Down Expand Up @@ -221,7 +221,7 @@ public async Task SendBatchTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -308,7 +308,7 @@ public async Task SendBatchMaxSizeTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -399,7 +399,7 @@ public async Task SendBatchHitExpiredTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -490,7 +490,7 @@ public async Task SendBatchWithPoolMaxSizeTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING, 5)
TrackingManagerConfig = new TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING, 5)
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -549,7 +549,7 @@ public async Task SendBatchFailedTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -632,7 +632,7 @@ public async Task ActivateFlagTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var shimeContext = ShimsContext.Create();
Expand Down Expand Up @@ -716,7 +716,7 @@ public async Task OnVisitorExposedTest()

var config = configMock.Object;
config.EnvId = "envId";
config.TrackingMangerConfig = new TrackingManagerConfig();
config.TrackingManagerConfig = new TrackingManagerConfig();

HttpResponseMessage httpResponse = new HttpResponseMessage
{
Expand Down Expand Up @@ -782,7 +782,7 @@ public async Task ActivateMultipleFlagTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var shimeContext = ShimsContext.Create();
Expand Down Expand Up @@ -890,7 +890,7 @@ public async Task ActivateMultipleFlagOnBatchTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var shimeContext = ShimsContext.Create();
Expand Down Expand Up @@ -998,7 +998,7 @@ public async Task ActivateFlagFailedTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down
22 changes: 11 additions & 11 deletions Flagship.Tests/Api/BatchingPeriodicCachingStrategyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task AddTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var hitsPoolQueue = new Dictionary<string, HitAbstract>();
Expand Down Expand Up @@ -87,7 +87,7 @@ public async Task SendBatchTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -171,7 +171,7 @@ public async Task SendBatchMaxSizeTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -262,7 +262,7 @@ public async Task SendBatchFailedTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -345,7 +345,7 @@ public async Task SendBatchHitExpiredTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -436,7 +436,7 @@ public async Task SendBatchWithPoolMaxSizeTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING, 5)
TrackingManagerConfig = new TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING, 5)
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -495,7 +495,7 @@ public async Task ActivateFlagTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var shimeContext = ShimsContext.Create();
Expand Down Expand Up @@ -580,7 +580,7 @@ public async Task ActivateMultipleFlagTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var shimeContext = ShimsContext.Create();
Expand Down Expand Up @@ -686,7 +686,7 @@ public async Task ActivateMultipleFlagOnBatchTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var shimeContext = ShimsContext.Create();
Expand Down Expand Up @@ -791,7 +791,7 @@ public async Task ActivateFlagFailedTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -873,7 +873,7 @@ public async Task MergedPoolQueue()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down
14 changes: 7 additions & 7 deletions Flagship.Tests/Api/NoBatchingContinuousCachingStrategyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task AddTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -105,7 +105,7 @@ public async Task AddFailedTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -179,7 +179,7 @@ public async Task NotConsentTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -314,7 +314,7 @@ public async Task NotConsentEmptyTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -385,7 +385,7 @@ public async Task ActivateFlagTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -466,7 +466,7 @@ public async Task ActivateFlagFailedTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

HttpResponseMessage httpResponse = new HttpResponseMessage
Expand Down Expand Up @@ -547,7 +547,7 @@ public async Task ActivateMultipleFlagOnBatchTest()
{
EnvId = "envID",
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new TrackingManagerConfig()
TrackingManagerConfig = new TrackingManagerConfig()
};

var shimeContext = ShimsContext.Create();
Expand Down
26 changes: 13 additions & 13 deletions Flagship.Tests/Api/TrackingManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void InitStrategy()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig()
TrackingManagerConfig = new Config.TrackingManagerConfig()
};

var trackingManager = new Flagship.Api.TrackingManager(config, httpClientMock.Object);
Expand All @@ -39,19 +39,19 @@ public void InitStrategy()

Assert.IsInstanceOfType(strategy, typeof(BatchingPeriodicCachingStrategy));

config.TrackingMangerConfig = new Config.TrackingManagerConfig(CacheStrategy.PERIODIC_CACHING);
config.TrackingManagerConfig = new Config.TrackingManagerConfig(CacheStrategy.PERIODIC_CACHING);

strategy = trackingManagerPrivate.Invoke("InitStrategy");

Assert.IsInstanceOfType(strategy, typeof(BatchingPeriodicCachingStrategy));

config.TrackingMangerConfig = new Config.TrackingManagerConfig(CacheStrategy.NO_BATCHING);
config.TrackingManagerConfig = new Config.TrackingManagerConfig(CacheStrategy.NO_BATCHING);

strategy = trackingManagerPrivate.Invoke("InitStrategy");

Assert.IsInstanceOfType(strategy, typeof(NoBatchingContinuousCachingStrategy));

config.TrackingMangerConfig = new Config.TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING);
config.TrackingManagerConfig = new Config.TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING);

strategy = trackingManagerPrivate.Invoke("InitStrategy");

Expand All @@ -69,7 +69,7 @@ public async Task Add()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig()
TrackingManagerConfig = new Config.TrackingManagerConfig()
};

var trackingManagerMock = new Mock<Flagship.Api.TrackingManager>(config, httpClientMock.Object)
Expand Down Expand Up @@ -103,7 +103,7 @@ public async Task ActivateFlag()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig()
TrackingManagerConfig = new Config.TrackingManagerConfig()
};

var trackingManagerMock = new Mock<Flagship.Api.TrackingManager>(config, httpClientMock.Object)
Expand Down Expand Up @@ -137,7 +137,7 @@ public async Task SendBatchTest()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig()
TrackingManagerConfig = new Config.TrackingManagerConfig()
};

var trackingManagerMock = new Mock<Flagship.Api.TrackingManager>(config, httpClientMock.Object)
Expand Down Expand Up @@ -172,7 +172,7 @@ public async Task StartBatchingLoopTest()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING,
TrackingManagerConfig = new Config.TrackingManagerConfig(CacheStrategy.CONTINUOUS_CACHING,
5, TimeSpan.FromMilliseconds(500)),
};

Expand Down Expand Up @@ -205,7 +205,7 @@ public async Task BatchingLoopTest()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig(),
TrackingManagerConfig = new Config.TrackingManagerConfig(),
};

var trackingManagerMock = new Mock<Flagship.Api.TrackingManager>(config, httpClientMock.Object)
Expand Down Expand Up @@ -233,7 +233,7 @@ public async Task BatchingLoopDuplicateTest()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig(),
TrackingManagerConfig = new Config.TrackingManagerConfig(),
};

var trackingManagerMock = new Mock<Flagship.Api.TrackingManager>(config, httpClientMock.Object)
Expand Down Expand Up @@ -269,7 +269,7 @@ public async Task LookupHitsAsync()
var config = new Flagship.Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig(),
TrackingManagerConfig = new Config.TrackingManagerConfig(),
HitCacheImplementation = hitCacheImplementation.Object,
};

Expand Down Expand Up @@ -385,7 +385,7 @@ public async Task LookupHitsBadFormatAsync()
var config = new Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig(),
TrackingManagerConfig = new Config.TrackingManagerConfig(),
HitCacheImplementation = hitCacheImplementation.Object,
};

Expand Down Expand Up @@ -448,7 +448,7 @@ public async Task LookupHitsAsyncThrowErrorTest()
var config = new Config.DecisionApiConfig
{
LogManager = fsLogManagerMock.Object,
TrackingMangerConfig = new Config.TrackingManagerConfig(),
TrackingManagerConfig = new Config.TrackingManagerConfig(),
HitCacheImplementation = hitCacheImplementation.Object,
};

Expand Down
Loading

0 comments on commit eb4342c

Please sign in to comment.