diff --git a/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTests.cs b/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTests.cs index daaaa26960..1189368937 100644 --- a/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTests.cs +++ b/test/Microsoft.IdentityModel.JsonWebTokens.Tests/JsonWebTokenHandlerTests.cs @@ -3617,7 +3617,11 @@ public static TheoryData JweDecompressSizeTheoryData TheoryData theoryData = new TheoryData(); +#if NETCOREAPP2_1 + string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 20_000_000), UU = new string('U', 15_000_000) }); +#else string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 100_000_000), UU = new string('U', 40_000_000) }); +#endif string token = jwth.CreateToken(payload, encryptingCredentials, "DEF"); theoryData.Add(new JWEDecompressionTheoryData { diff --git a/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs b/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs index 6c940524e9..f5f3deaf18 100644 --- a/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs +++ b/test/System.IdentityModel.Tokens.Jwt.Tests/JwtSecurityTokenHandlerTests.cs @@ -1148,7 +1148,11 @@ public static TheoryData JweDecompressSizeTheoryData TheoryData theoryData = new TheoryData(); +#if NETCOREAPP2_1 + string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 20_000_000), UU = new string('U', 15_000_000) }); +#else string payload = System.Text.Json.JsonSerializer.Serialize(new { U = new string('U', 100_000_000), UU = new string('U', 40_000_000) }); +#endif string token = jwth.CreateToken(payload, encryptingCredentials, "DEF"); theoryData.Add(new JWEDecompressionTheoryData {