Skip to content

Commit

Permalink
Fixing merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbronson committed Jul 20, 2020
1 parent 0160513 commit a4b438f
Show file tree
Hide file tree
Showing 37 changed files with 91 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.27.1-NestedEdge" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.27.1-NestedEdge-1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.27.1-NestedEdge" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge-1" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.27.1-NestedEdge-1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.4.4" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge-1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge-1" />
<PackageReference Include="Stateless" Version="4.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="App.Metrics" Version="3.0.0" />
<PackageReference Include="JetBrains.Annotations" Version="2018.3.0" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.27.1-NestedEdge" />
<PackageReference Include="Microsoft.Azure.Devices.Client" Version="1.27.1-NestedEdge-1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge" />
<PackageReference Include="Microsoft.Azure.Devices" Version="1.22.2-NestedEdge-1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,8 @@ protected override void Load(ContainerBuilder builder)
this.useServerHeartbeat,
proxy,
productInfoStore,
<<<<<<< HEAD:edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Service/modules/RoutingModule.cs
modelIdStore,
this.nestedEdgeEnabled);
=======
modelIdStore);
>>>>>>> master:edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/modules/RoutingModule.cs
return cloudConnectionProvider;
})
.As<Task<ICloudConnectionProvider>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ public void Test_Create_DeviceIdentity_WithAuthMethod_ShouldCreateDeviceClient()
var authenticationMethod = new DeviceAuthenticationWithToken(DeviceId, token);

var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs
IClient client = new ClientProvider(Option.None<string>()).Create(identity, authenticationMethod, transportSettings);
=======
IClient client = new ClientProvider().Create(identity, authenticationMethod, transportSettings, Option.None<string>());
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs

IClient client = new ClientProvider(Option.None<string>()).Create(identity, authenticationMethod, transportSettings, Option.None<string>());
Assert.NotNull(client);
Assert.True(client is DeviceClientWrapper);
}
Expand Down Expand Up @@ -83,11 +78,7 @@ public void Test_Create_ModuleIdentity_WithAuthMethod_ShouldCreateModuleClient()
var authenticationMethod = new ModuleAuthenticationWithToken(DeviceId, ModuleId, token);

var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs
IClient client = new ClientProvider(Option.None<string>()).Create(identity, authenticationMethod, transportSettings);
=======
IClient client = new ClientProvider().Create(identity, authenticationMethod, transportSettings, Option.None<string>());
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs
IClient client = new ClientProvider(Option.None<string>()).Create(identity, authenticationMethod, transportSettings, Option.None<string>());

Assert.NotNull(client);
Assert.True(client is ModuleClientWrapper);
Expand All @@ -113,7 +104,7 @@ public void Test_Create_ModuleIdentity_WithTokenProvider_ShouldCreateModuleClien

var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
ITokenProvider tokenProvider = new TestTokenProvider();
IClient client = new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.None<string>());
IClient client = new ClientProvider(Option.None<string>()).Create(identity, tokenProvider, transportSettings, Option.None<string>());

Assert.NotNull(client);
Assert.True(client is ModuleClientWrapper);
Expand All @@ -126,7 +117,7 @@ public void Test_Create_DeviceIdentity_WithTokenProvider_ShouldCreateDeviceClien

var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
ITokenProvider tokenProvider = new TestTokenProvider();
IClient client = new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.None<string>());
IClient client = new ClientProvider(Option.None<string>()).Create(identity, tokenProvider, transportSettings, Option.None<string>());

Assert.NotNull(client);
Assert.True(client is DeviceClientWrapper);
Expand All @@ -140,7 +131,7 @@ public void Test_Create_ModuleIdentity_WithTokenProvider_AndModelId_ShouldCreate
var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
string modelId = "testModelId";
ITokenProvider tokenProvider = new TestTokenProvider();
IClient client = new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.Some(modelId));
IClient client = new ClientProvider(Option.None<string>()).Create(identity, tokenProvider, transportSettings, Option.Some(modelId));

Assert.NotNull(client);
Assert.True(client is ModuleClientWrapper);
Expand All @@ -154,7 +145,35 @@ public void Test_Create_DeviceIdentity_WithTokenProvider_AndModelId_ShouldCreate
var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
string modelId = "testModelId";
ITokenProvider tokenProvider = new TestTokenProvider();
IClient client = new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.Some(modelId));
IClient client = new ClientProvider(Option.None<string>()).Create(identity, tokenProvider, transportSettings, Option.Some(modelId));

Assert.NotNull(client);
Assert.True(client is DeviceClientWrapper);
}

[Fact]
public void Test_Create_ModuleIdentity_WithTokenProvider_AndModelId_AndGatewayHostName_ShouldCreateModuleClient()
{
IIdentity identity = new ModuleIdentity(IotHubHostName, DeviceId, ModuleId);

var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
string modelId = "testModelId";
ITokenProvider tokenProvider = new TestTokenProvider();
IClient client = new ClientProvider(Option.Some("testGatewayHostName")).Create(identity, tokenProvider, transportSettings, Option.Some(modelId));

Assert.NotNull(client);
Assert.True(client is ModuleClientWrapper);
}

[Fact]
public void Test_Create_DeviceIdentity_WithTokenProvider_AndModelId_AndGatewayHostName_ShouldCreateDeviceClient()
{
IIdentity identity = new DeviceIdentity(IotHubHostName, DeviceId);

var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
string modelId = "testModelId";
ITokenProvider tokenProvider = new TestTokenProvider();
IClient client = new ClientProvider(Option.Some("testGatewayHostName")).Create(identity, tokenProvider, transportSettings, Option.Some(modelId));

Assert.NotNull(client);
Assert.True(client is DeviceClientWrapper);
Expand Down Expand Up @@ -196,7 +215,7 @@ public void Throw_OnWhitespaceModelId()
var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
string modelId = " ";
ITokenProvider tokenProvider = new TestTokenProvider();
Assert.Throws<ArgumentException>(() => new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.Some(modelId)));
Assert.Throws<ArgumentException>(() => new ClientProvider(Option.None<string>()).Create(identity, tokenProvider, transportSettings, Option.Some(modelId)));
}

[Fact]
Expand All @@ -207,7 +226,7 @@ public void Throw_OnEmptyModelId()
var transportSettings = new ITransportSettings[] { new MqttTransportSettings(TransportType.Mqtt_Tcp_Only) };
string modelId = string.Empty;
ITokenProvider tokenProvider = new TestTokenProvider();
Assert.Throws<ArgumentException>(() => new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.Some(modelId)));
Assert.Throws<ArgumentException>(() => new ClientProvider(Option.None<string>()).Create(identity, tokenProvider, transportSettings, Option.Some(modelId)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,8 @@ IClient GetMockedDeviceClient()
false,
Option.None<IWebProxy>(),
productInfoStore,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientTokenCloudConnectionTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientTokenCloudConnectionTest.cs
cloudConnectionProvider.BindEdgeHub(Mock.Of<IEdgeHub>());
var deviceConnectivityManager = Mock.Of<IDeviceConnectivityManager>();
IConnectionManager connectionManager = new ConnectionManager(cloudConnectionProvider, Mock.Of<ICredentialsCache>(), new IdentityProvider(hostname), deviceConnectivityManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,8 @@ public async Task ConnectUsingTokenCredentialsTest()
false,
Option.None<IWebProxy>(),
productInfoStore,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
cloudConnectionProvider.BindEdgeHub(edgeHub);

var deviceIdentity = Mock.Of<IDeviceIdentity>(m => m.Id == "d1");
Expand Down Expand Up @@ -203,11 +200,8 @@ public async Task ConnectUsingInvalidTokenCredentialsTest()
false,
Option.None<IWebProxy>(),
productInfoStore,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
cloudConnectionProvider.BindEdgeHub(edgeHub);

var deviceIdentity = Mock.Of<IDeviceIdentity>(m => m.Id == "d1");
Expand Down Expand Up @@ -255,11 +249,8 @@ public async Task ConnectUsingIdentityInScopeTest()
false,
Option.None<IWebProxy>(),
productInfoStore,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
cloudConnectionProvider.BindEdgeHub(edgeHub);

// Act
Expand Down Expand Up @@ -306,11 +297,8 @@ public async Task ConnectUsingIdentityInCacheTest()
false,
Option.None<IWebProxy>(),
productInfoStore,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
cloudConnectionProvider.BindEdgeHub(edgeHub);

// Act
Expand Down Expand Up @@ -357,11 +345,8 @@ public async Task ConnectUsingIdentityInCacheTest2()
false,
Option.None<IWebProxy>(),
productInfoStore,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs
cloudConnectionProvider.BindEdgeHub(edgeHub);

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,14 +1028,9 @@ public async Task TestCloseDeviceAndCloudConnection(bool closeCloudConnectionOnD
ICredentialsCache credentialsCache = new CredentialsCache(new NullCredentialsCache());
await credentialsCache.Add(module1Credentials);
var productInfoStore = Mock.Of<IProductInfoStore>();
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs

var deviceScopeIdentitiesCache = new Mock<IDeviceScopeIdentitiesCache>();
deviceScopeIdentitiesCache.Setup(d => d.GetAuthChain(It.Is<string>(i => i == module1Credentials.Identity.Id))).ReturnsAsync(Option.Some(module1Credentials.Identity.Id));

=======
var modelIdStore = Mock.Of<IModelIdStore>();
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs
var cloudConnectionProvider = new CloudConnectionProvider(
messageConverterProvider,
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,8 @@ public async Task TestSendMessages()
false,
Option.None<IWebProxy>(),
productInfoStore.Object,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs
connectionProvider.BindEdgeHub(edgeHub.Object);

var deviceConnectivityManager = Mock.Of<IDeviceConnectivityManager>();
Expand Down Expand Up @@ -196,11 +193,8 @@ public async Task TestGetTwin()
false,
Option.None<IWebProxy>(),
productInfoStore.Object,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs
connectionProvider.BindEdgeHub(edgeHub.Object);

var deviceConnectivityManager = Mock.Of<IDeviceConnectivityManager>();
Expand Down Expand Up @@ -289,11 +283,8 @@ public async Task TestMultipleOperations()
false,
Option.None<IWebProxy>(),
productInfoStore.Object,
<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs
modelIdStore,
true);
=======
modelIdStore);
>>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs
connectionProvider.BindEdgeHub(edgeHub.Object);

var deviceConnectivityManager = Mock.Of<IDeviceConnectivityManager>();
Expand Down
Loading

0 comments on commit a4b438f

Please sign in to comment.