Skip to content

Commit

Permalink
Make SecurityContext field name camelCase (#4433)
Browse files Browse the repository at this point in the history
To be consistent with other field names in configuration file. We may
want to improve to be case insensitive of all field names in the future.
  • Loading branch information
yao-msft committed May 1, 2024
1 parent ea98536 commit c2781b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -99,7 +99,7 @@ namespace AppInstaller::CLI::ConfigurationRemoting
// Support for 0.2 schema via metadata value
// TODO: Support case insensitive lookup by iteration
auto unitMetadata = unit.Metadata();
auto securityContext = unitMetadata.TryLookup(L"SecurityContext");
auto securityContext = unitMetadata.TryLookup(L"securityContext");
if (securityContext)
{
auto securityContextProperty = securityContext.try_as<IPropertyValue>();
Expand Down
Expand Up @@ -487,7 +487,7 @@ public void TestSet_Serialize_0_2()
directives:
description: FakeDescription
allowPrerelease: true
SecurityContext: elevated
securityContext: elevated
settings:
TestString: Hello
TestBool: false
Expand All @@ -501,7 +501,7 @@ public void TestSet_Serialize_0_2()
- dependency3
directives:
description: FakeDescription2
SecurityContext: elevated
securityContext: elevated
settings:
TestString: Bye
TestBool: true
Expand Down Expand Up @@ -529,14 +529,14 @@ public void TestSet_Serialize_0_2()
Assert.Equal("FakeModule", set.Units[0].Type);
Assert.Equal(ConfigurationUnitIntent.Assert, set.Units[0].Intent);
Assert.Equal("TestId", set.Units[0].Identifier);
this.VerifyValueSet(set.Units[0].Metadata, new ("description", "FakeDescription"), new ("allowPrerelease", true), new ("SecurityContext", "elevated"));
this.VerifyValueSet(set.Units[0].Metadata, new ("description", "FakeDescription"), new ("allowPrerelease", true), new ("securityContext", "elevated"));
this.VerifyValueSet(set.Units[0].Settings, new ("TestString", "Hello"), new ("TestBool", false), new ("TestInt", 1234));

Assert.Equal("FakeModule2", set.Units[1].Type);
Assert.Equal(ConfigurationUnitIntent.Apply, set.Units[1].Intent);
Assert.Equal("TestId2", set.Units[1].Identifier);
this.VerifyStringArray(set.Units[1].Dependencies, "TestId", "dependency2", "dependency3");
this.VerifyValueSet(set.Units[1].Metadata, new ("description", "FakeDescription2"), new ("SecurityContext", "elevated"));
this.VerifyValueSet(set.Units[1].Metadata, new ("description", "FakeDescription2"), new ("securityContext", "elevated"));

ValueSet mapping = new ValueSet();
mapping.Add("Key", "TestValue");
Expand Down

0 comments on commit c2781b0

Please sign in to comment.