Skip to content

Commit f4ececf

Browse files
authored
feature/bump dependencies (#70)
* Bump dependencies to latest to ensure we don't implicitly reference deprecated packages * bump fluent assertions to last apache 2.0 release * bump nupkg-validator
1 parent 1002fa8 commit f4ececf

38 files changed

+124
-14392
lines changed

Elastic.Abstractions.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Xunit.ExampleMinima
2121
EndProject
2222
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Managed.Example", "examples\Elastic.Managed.Example\Elastic.Managed.Example.csproj", "{294F5209-AD64-4812-AA4E-C7B016927A0F}"
2323
EndProject
24-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nest.TypescriptExporter", "src\Nest.TypescriptExporter\Nest.TypescriptExporter.csproj", "{C05F7B36-EEF7-4BCD-86A2-F5F1BB8CFEB9}"
25-
EndProject
2624
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Stack.ArtifactsApi", "src\Elastic.Stack.ArtifactsApi\Elastic.Stack.ArtifactsApi.csproj", "{80DE8673-CB3E-4D0B-99F4-A5CECF6BE752}"
2725
EndProject
2826
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{77E78EDE-60D5-469A-B431-443A7966A243}"
@@ -62,7 +60,6 @@ Global
6260
{0FCE020D-F4BD-4933-A0AB-27537EFA273E} = {77E78EDE-60D5-469A-B431-443A7966A243}
6361
{681C6112-B885-4553-A06C-4CD9C262FC49} = {77E78EDE-60D5-469A-B431-443A7966A243}
6462
{80DE8673-CB3E-4D0B-99F4-A5CECF6BE752} = {77E78EDE-60D5-469A-B431-443A7966A243}
65-
{C05F7B36-EEF7-4BCD-86A2-F5F1BB8CFEB9} = {77E78EDE-60D5-469A-B431-443A7966A243}
6663
{D6997ADC-E933-418E-831C-DE1A78897493} = {F75ACC18-D314-4F1F-88A3-2002EAC4E207}
6764
{9666AFDC-B0E8-489C-A25A-17E67303A969} = {9D154338-4AA8-40A9-A378-B27C05D45791}
6865
EndGlobalSection
@@ -102,10 +99,6 @@ Global
10299
{294F5209-AD64-4812-AA4E-C7B016927A0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
103100
{294F5209-AD64-4812-AA4E-C7B016927A0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
104101
{294F5209-AD64-4812-AA4E-C7B016927A0F}.Release|Any CPU.Build.0 = Release|Any CPU
105-
{C05F7B36-EEF7-4BCD-86A2-F5F1BB8CFEB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
106-
{C05F7B36-EEF7-4BCD-86A2-F5F1BB8CFEB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
107-
{C05F7B36-EEF7-4BCD-86A2-F5F1BB8CFEB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
108-
{C05F7B36-EEF7-4BCD-86A2-F5F1BB8CFEB9}.Release|Any CPU.Build.0 = Release|Any CPU
109102
{80DE8673-CB3E-4D0B-99F4-A5CECF6BE752}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
110103
{80DE8673-CB3E-4D0B-99F4-A5CECF6BE752}.Debug|Any CPU.Build.0 = Debug|Any CPU
111104
{80DE8673-CB3E-4D0B-99F4-A5CECF6BE752}.Release|Any CPU.ActiveCfg = Release|Any CPU

dotnet-tools.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,29 @@
66
"version": "4.3.0",
77
"commands": [
88
"minver"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"assembly-differ": {
1213
"version": "0.14.0",
1314
"commands": [
1415
"assembly-differ"
15-
]
16+
],
17+
"rollForward": false
1618
},
1719
"release-notes": {
1820
"version": "0.5.2",
1921
"commands": [
2022
"release-notes"
21-
]
23+
],
24+
"rollForward": false
2225
},
2326
"nupkg-validator": {
24-
"version": "0.5.0",
27+
"version": "0.7.0",
2528
"commands": [
2629
"nupkg-validator"
27-
]
30+
],
31+
"rollForward": false
2832
}
2933
}
3034
}

examples/Elastic.Ephemeral.Example/Elastic.Ephemeral.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Elastic.Transport" Version="0.4.18" />
16+
<PackageReference Include="Elastic.Transport" Version="0.9.2" />
1717
</ItemGroup>
1818

1919
</Project>

examples/Elastic.Ephemeral.Example/Program.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@
2424

2525
var pool = new StaticNodePool(cluster.NodesUris());
2626
var transportConfig = new TransportConfiguration(pool, productRegistration: ElasticsearchProductRegistration.Default)
27-
.Authentication(new BasicAuthentication(Admin.Username, Admin.Password))
28-
.ServerCertificateValidationCallback(CertificateValidations.AllowAll);
29-
if (cluster.DetectedProxy != DetectedProxySoftware.None)
30-
transportConfig = transportConfig.Proxy(new Uri("http://localhost:8080"), null!, null!);
27+
{
28+
Authentication = new BasicAuthentication(Admin.Username, Admin.Password),
29+
ServerCertificateValidationCallback = CertificateValidations.AllowAll,
30+
ProxyAddress = cluster.DetectedProxy == DetectedProxySoftware.None
31+
? null
32+
: "http://localhost:8080"
33+
};
3134

3235
var transport = new DistributedTransport(transportConfig);
3336

examples/Elastic.Xunit.ExampleComplex/ClusterTestClassBase.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5+
using Elastic.Clients.Elasticsearch;
56
using Elastic.Elasticsearch.Ephemeral;
67
using Elastic.Elasticsearch.Xunit.XunitPlumbing;
7-
using Nest;
88

99
namespace Elastic.Xunit.ExampleComplex
1010
{
11-
public abstract class ClusterTestClassBase<TCluster> : IClusterFixture<TCluster>
11+
public abstract class ClusterTestClassBase<TCluster>(TCluster cluster)
12+
: IClusterFixture<TCluster>
1213
where TCluster : IEphemeralCluster<EphemeralClusterConfiguration>, IMyCluster, new()
1314
{
14-
protected ClusterTestClassBase(TCluster cluster) => Cluster = cluster;
15-
public TCluster Cluster { get; }
16-
public IElasticClient Client => Cluster.Client;
15+
public TCluster Cluster { get; } = cluster;
16+
public ElasticsearchClient Client => Cluster.Client;
1717
}
1818
}

examples/Elastic.Xunit.ExampleComplex/Clusters.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,45 @@
33
// See the LICENSE file in the project root for more information
44

55
using System.Collections.Concurrent;
6+
using Elastic.Clients.Elasticsearch;
67
using Elastic.Elasticsearch.Ephemeral;
78
using Elastic.Elasticsearch.Xunit;
8-
using Elasticsearch.Net;
9-
using Nest;
9+
using Elastic.Transport;
1010

1111
namespace Elastic.Xunit.ExampleComplex
1212
{
1313
internal static class EphemeralClusterExtensions
1414
{
15-
private static readonly ConcurrentDictionary<IEphemeralCluster, IElasticClient> Clients = new();
15+
private static readonly ConcurrentDictionary<IEphemeralCluster, ElasticsearchClient> Clients = new();
1616

17-
public static IElasticClient GetOrAddClient(this IEphemeralCluster cluster) =>
17+
public static ElasticsearchClient GetOrAddClient(this IEphemeralCluster cluster) =>
1818
Clients.GetOrAdd(cluster, c =>
1919
{
20-
var connectionPool = new StaticConnectionPool(c.NodesUris());
21-
var settings = new ConnectionSettings(connectionPool);
22-
var client = new ElasticClient(settings);
20+
var connectionPool = new StaticNodePool(c.NodesUris());
21+
var settings = new ElasticsearchClientSettings(connectionPool);
22+
var client = new ElasticsearchClient(settings);
2323
return client;
2424
});
2525
}
2626

2727
public interface IMyCluster
2828
{
29-
IElasticClient Client { get; }
29+
ElasticsearchClient Client { get; }
3030
}
3131

3232
public abstract class MyClusterBase() : XunitClusterBase(new XunitClusterConfiguration(MyRunOptions.TestVersion)
3333
{
3434
ShowElasticsearchOutputAfterStarted = false,
3535
}), IMyCluster
3636
{
37-
public IElasticClient Client => this.GetOrAddClient();
37+
public ElasticsearchClient Client => this.GetOrAddClient();
3838
}
3939

4040
public class TestCluster : MyClusterBase
4141
{
4242
protected override void SeedCluster()
4343
{
44-
var pluginsResponse = Client.CatPlugins();
44+
var response = Client.Info();
4545
}
4646
}
4747

@@ -51,11 +51,11 @@ public TestGenericCluster() : base(new XunitClusterConfiguration(MyRunOptions.Te
5151
{
5252
}
5353

54-
public IElasticClient Client => this.GetOrAddClient();
54+
public ElasticsearchClient Client => this.GetOrAddClient();
5555

5656
protected override void SeedCluster()
5757
{
58-
var aliasesResponse = Client.CatAliases();
58+
var response = Client.Info();
5959
}
6060
}
6161
}

examples/Elastic.Xunit.ExampleComplex/Elastic.Xunit.ExampleComplex.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
</PropertyGroup>
66
<ItemGroup>
77
<ProjectReference Include="..\..\src\Elastic.Elasticsearch.Ephemeral\Elastic.Elasticsearch.Ephemeral.csproj" />
8+
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="9.0.4" />
89
<PackageReference Include="xunit" Version="2.9.2" />
910
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
1011
<PrivateAssets>all</PrivateAssets>
1112
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1213
</PackageReference>
1314
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
14-
15-
<PackageReference Include="NEST" Version="6.0.1" />
16-
<PackageReference Include="FluentAssertions" Version="5.1.2" />
15+
<PackageReference Include="FluentAssertions" Version="7.2.0" />
1716
<PackageReference Condition="'$(TargetFramework)' == 'net461'" Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
1817
<ProjectReference Include="..\..\src\Elastic.Elasticsearch.Xunit\Elastic.Elasticsearch.Xunit.csproj" />
1918
</ItemGroup>

examples/Elastic.Xunit.ExampleComplex/TestWithoutClusterFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class TestWithoutClusterFixture
1515
public void Test()
1616
{
1717
(1 + 1).Should().Be(2);
18-
var info = ElasticXunitRunner.CurrentCluster.GetOrAddClient().RootNodeInfo();
18+
var info = ElasticXunitRunner.CurrentCluster.GetOrAddClient().Info();
1919
info.Name.Should().NotBeNullOrWhiteSpace();
2020
}
2121
}

examples/Elastic.Xunit.ExampleComplex/Tests.cs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,25 @@
33
// See the LICENSE file in the project root for more information
44

55
using Elastic.Elasticsearch.Xunit.XunitPlumbing;
6-
using Elasticsearch.Net;
76
using FluentAssertions;
87

98
namespace Elastic.Xunit.ExampleComplex
109
{
11-
public class MyTestClass : ClusterTestClassBase<TestCluster>
10+
public class MyTestClass(TestCluster cluster)
11+
: ClusterTestClassBase<TestCluster>(cluster)
1212
{
13-
public MyTestClass(TestCluster cluster) : base(cluster) { }
14-
1513
[I]
1614
public void SomeTest()
1715
{
18-
var info = Client.RootNodeInfo();
19-
20-
info.IsValid.Should().BeTrue();
16+
var info = Client.Info();
2117

22-
Client.CreateIndex("INASda");
23-
Client.LowLevel.Search<StringResponse>(PostData.Serializable(new {query = new {query_string = 1}}));
18+
info.IsValidResponse.Should().BeTrue();
2419
}
2520
}
2621

27-
public class Tests1 : ClusterTestClassBase<TestCluster>
22+
public class Tests1(TestCluster cluster)
23+
: ClusterTestClassBase<TestCluster>(cluster)
2824
{
29-
public Tests1(TestCluster cluster) : base(cluster) { }
30-
3125
[U] public void Unit1Test() => (1 + 1).Should().Be(2);
3226
[U] public void Unit1Test1() => (1 + 1).Should().Be(2);
3327
[U] public void Unit1Test2() => (1 + 1).Should().Be(2);
@@ -67,9 +61,9 @@ public MyGenericTestClass(TestGenericCluster cluster) : base(cluster) { }
6761

6862
[I] public void SomeTest()
6963
{
70-
var info = Client.RootNodeInfo();
64+
var info = Client.Info();
7165

72-
info.IsValid.Should().BeTrue();
66+
info.IsValidResponse.Should().BeTrue();
7367
}
7468
[U] public void MyGenericUnitTest() => (1 + 1).Should().Be(2);
7569
[U] public void MyGenericUnitTest1() => (1 + 1).Should().Be(2);
@@ -81,16 +75,15 @@ [I] public void SomeTest()
8175
}
8276

8377
[SkipVersion("<6.2.0", "")]
84-
public class SkipTestClass : ClusterTestClassBase<TestGenericCluster>
78+
public class SkipTestClass(TestGenericCluster cluster)
79+
: ClusterTestClassBase<TestGenericCluster>(cluster)
8580
{
86-
public SkipTestClass(TestGenericCluster cluster) : base(cluster) { }
87-
8881
[I]
8982
public void SomeTest()
9083
{
91-
var info = Client.RootNodeInfo();
84+
var info = Client.Info();
9285

93-
info.IsValid.Should().BeTrue();
86+
info.IsValidResponse.Should().BeTrue();
9487
}
9588

9689
[U]
@@ -99,7 +92,7 @@ public void SomeTest()
9992

10093
public class DirectInterfaceTests : IClusterFixture<TestGenericCluster>
10194
{
102-
public DirectInterfaceTests(TestGenericCluster cluster) { }
95+
public DirectInterfaceTests(TestGenericCluster _) { }
10396

10497
[U]
10598
public void DirectUnitTest() => (1 + 1).Should().Be(2);

examples/Elastic.Xunit.ExampleMinimal/Elastic.Xunit.ExampleMinimal.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
<IsPackable>False</IsPackable>
55
</PropertyGroup>
66
<ItemGroup>
7+
<PackageReference Include="Elastic.Clients.Elasticsearch" Version="9.0.4" />
78
<PackageReference Include="xunit" Version="2.9.2" />
89
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
910
<PrivateAssets>all</PrivateAssets>
1011
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1112
</PackageReference>
1213
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
13-
<PackageReference Include="NEST" Version="6.0.1" />
14-
<PackageReference Include="FluentAssertions" Version="5.1.2" />
14+
<PackageReference Include="FluentAssertions" Version="7.2.0" />
1515
</ItemGroup>
1616
<ItemGroup>
1717
<ProjectReference Include="..\..\src\Elastic.Elasticsearch.Xunit\Elastic.Elasticsearch.Xunit.csproj" />

examples/Elastic.Xunit.ExampleMinimal/ExampleTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
// See the LICENSE file in the project root for more information
44

5+
using Elastic.Clients.Elasticsearch;
56
using Elastic.Elasticsearch.Xunit;
67
using Elastic.Elasticsearch.Xunit.XunitPlumbing;
7-
using Elasticsearch.Net;
8+
using Elastic.Transport;
89
using FluentAssertions;
9-
using Nest;
1010
using Xunit;
1111

1212
// we need to put this assembly attribute in place for xunit to use our custom test execution pipeline
@@ -21,7 +21,7 @@ public class MyTestCluster : XunitClusterBase
2121
/// We pass our configuration instance to the base class.
2222
/// We only configure it to run version 6.2.3 here but lots of additional options are available.
2323
/// </summary>
24-
public MyTestCluster() : base(new XunitClusterConfiguration("latest-8"))
24+
public MyTestCluster() : base(new XunitClusterConfiguration("latest-9"))
2525
{
2626
}
2727
}
@@ -40,19 +40,19 @@ public ExampleTest(MyTestCluster cluster) =>
4040
Client = cluster.GetOrAddClient(c =>
4141
{
4242
var nodes = cluster.NodesUris();
43-
var connectionPool = new StaticConnectionPool(nodes);
44-
var settings = new ConnectionSettings(connectionPool)
43+
var connectionPool = new StaticNodePool(nodes);
44+
var settings = new ElasticsearchClientSettings(connectionPool)
4545
.EnableDebugMode();
46-
return new ElasticClient(settings);
46+
return new ElasticsearchClient(settings);
4747
});
4848

49-
private ElasticClient Client { get; }
49+
private ElasticsearchClient Client { get; }
5050

5151
/// <summary> [I] marks an integration test (like [Fact] would for plain Xunit) </summary>
5252
[I]
5353
public void SomeTest()
5454
{
55-
var rootNodeInfo = Client.RootNodeInfo();
55+
var rootNodeInfo = Client.Info();
5656

5757
rootNodeInfo.Name.Should().NotBeNullOrEmpty();
5858
}

0 commit comments

Comments
 (0)