Skip to content

Commit b9aeb04

Browse files
committed
fixed rolemapping failing integration test due to difference in null handling when using custom source serializer
1 parent 40c96db commit b9aeb04

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Tests/XPack/Security/RoleMapping/RoleMappingCrudTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ protected override void ExpectAfterCreate(IGetRoleMappingResponse response)
135135

136136
mapping.Enabled.Should().BeFalse();
137137
mapping.Roles.Should().BeEquivalentTo("admin");
138-
mapping.Metadata.Should().HaveCount(1).And.ContainKeys("x");
138+
//source serializer includes nulls on deserialize
139+
if (TestClient.Configuration.UsingCustomSourceSerializer)
140+
mapping.Metadata.Should().HaveCount(2).And.ContainKeys("x", "z");
141+
else
142+
mapping.Metadata.Should().HaveCount(1).And.ContainKeys("x");
139143
mapping.Rules.Should().NotBeNull();
140144

141145
var allMapping = mapping.Rules as AllRoleMappingRule;

0 commit comments

Comments
 (0)