fix(adminui): case-insensitive resilience policy keys + malformed-json test (review)
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ public sealed class ResilienceFormModel
|
|||||||
|
|
||||||
// capability name -> (timeout, retry, breaker), each nullable.
|
// capability name -> (timeout, retry, breaker), each nullable.
|
||||||
public Dictionary<string, CapabilityRow> Policies { get; set; } =
|
public Dictionary<string, CapabilityRow> Policies { get; set; } =
|
||||||
Capabilities.ToDictionary(c => c, _ => new CapabilityRow());
|
Capabilities.ToDictionary(c => c, _ => new CapabilityRow(), StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
public sealed class CapabilityRow
|
public sealed class CapabilityRow
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ public class ResilienceFormModelTests
|
|||||||
back.Policies["Write"].IsEmpty.ShouldBeTrue();
|
back.Policies["Write"].IsEmpty.ShouldBeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Malformed_json_yields_empty_model()
|
||||||
|
{
|
||||||
|
var m = ResilienceFormModel.FromJson("{ not valid json");
|
||||||
|
m.BulkheadMaxConcurrent.ShouldBeNull();
|
||||||
|
m.Policies["Read"].IsEmpty.ShouldBeTrue();
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Emitted_json_is_consumable_by_the_runtime_parser()
|
public void Emitted_json_is_consumable_by_the_runtime_parser()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user