Skip to content

Commit 1c5f24d

Browse files
committed
Started on metafield mapping tests (ttl)
1 parent 2ca9382 commit 1c5f24d

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

Diff for: src/CodeGeneration/Nest.Litterateur/project.lock.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -3088,7 +3088,8 @@
30883088
},
30893089
"Microsoft.CSharp/4.0.1-beta-23409": {
30903090
"type": "package",
3091-
"sha512": "I1jsSsyK89VfNebrnx2eiBD5YT6zp+DcX2v6AxZ/IosS38QYmA9YKVmssMd5yhRkXwr1f8MfgZTxF1Cli90JEQ==",
3091+
"serviceable": true,
3092+
"sha512": "GGOOJF47WzXZoka0JHCToQxzSguIy1UeXZywUjA1NPqvKAWVwbSbZ2VxyeIL3jyTV1BHEbBX8FPL6vweUON2aw==",
30923093
"files": [
30933094
"lib/dotnet/de/Microsoft.CSharp.xml",
30943095
"lib/dotnet/es/Microsoft.CSharp.xml",
@@ -4129,7 +4130,7 @@
41294130
"System.Reflection.Metadata/1.1.0": {
41304131
"type": "package",
41314132
"serviceable": true,
4132-
"sha512": "a8VsRm/B0Ik1o5FumSMWmpwbG7cvIIajAYhzTTy9VB9XItByJDQHGZkQTIAdsvVJ6MI5O3uH/lb0izgQDlDIWA==",
4133+
"sha512": "RLIE4sSt2zngMLuqM6YmxBH99mTumtT4DNZE4+msfEaInUP5iCLQT+BHPl+2cjSAP1pdALyAjLB8RtCB+WGGWQ==",
41334134
"files": [
41344135
"lib/dotnet5.2/System.Reflection.Metadata.dll",
41354136
"lib/dotnet5.2/System.Reflection.Metadata.xml",

Diff for: src/Tests/Mapping/Metafields/MetafieldsMappingApiTestsBase.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
using System.Collections.Generic;
88
using Elasticsearch.Net;
99
using static Nest.Infer;
10+
using Xunit;
1011

1112
namespace Tests.Mapping.Metafields
1213
{
14+
[Collection(IntegrationContext.ReadOnly)]
1315
public abstract class MetafieldsMappingApiTestsBase : ApiTestBase<IPutMappingResponse, IPutMappingRequest, PutMappingDescriptor<Project>, PutMappingRequest<Project>>
1416
{
15-
public MetafieldsMappingApiTestsBase(IndexingCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
17+
public MetafieldsMappingApiTestsBase(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
1618

1719
protected override LazyResponses ClientUsage() => Calls(
1820
fluent: (client, f) => client.Map(f),

Diff for: src/Tests/Mapping/Metafields/Ttl/TypeMappingTestBase.cs

+5-12
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,22 @@ namespace Tests.Mapping.Metafields.Ttl
1212
{
1313
public class TtlMetafieldApiTest : MetafieldsMappingApiTestsBase
1414
{
15-
public TtlMetafieldApiTest(IndexingCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
15+
public TtlMetafieldApiTest(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { }
1616

1717
protected override object ExpectJson { get; } = new
1818
{
19-
properties = new
20-
{
21-
name = new
22-
{
23-
type = "string",
24-
index = "not_analyzed"
25-
}
26-
}
19+
_ttl = new { @default = "30m", enabled = true }
2720
};
2821

29-
protected override Func<PutMappingDescriptor<Project>, IPutMappingRequest> Fluent => d => d
30-
.Index(CallIsolatedValue)
22+
protected override Func<PutMappingDescriptor<Project>, IPutMappingRequest> Fluent => d => d.Index(CallIsolatedValue)
3123
.TtlField(ttl => ttl
3224
.Default("30m")
25+
.Enable()
3326
);
3427

3528
protected override PutMappingRequest<Project> Initializer => new PutMappingRequest<Project>(CallIsolatedValue, Type<Project>())
3629
{
37-
TtlField = new TtlField { Default = "30m" }
30+
TtlField = new TtlField { Default = TimeSpan.FromMinutes(30), Enabled = true }
3831
};
3932
}
4033
}

0 commit comments

Comments
 (0)