diff --git a/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Diagnostics/Microsoft.Azure.Devices.Edge.Agent.Diagnostics.csproj b/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Diagnostics/Microsoft.Azure.Devices.Edge.Agent.Diagnostics.csproj index 741b6544be4..a824e333641 100644 --- a/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Diagnostics/Microsoft.Azure.Devices.Edge.Agent.Diagnostics.csproj +++ b/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Diagnostics/Microsoft.Azure.Devices.Edge.Agent.Diagnostics.csproj @@ -9,7 +9,7 @@ - + diff --git a/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/Microsoft.Azure.Devices.Edge.Agent.IoTHub.csproj b/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/Microsoft.Azure.Devices.Edge.Agent.IoTHub.csproj index 512860a33bc..0a683899e83 100644 --- a/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/Microsoft.Azure.Devices.Edge.Agent.IoTHub.csproj +++ b/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/Microsoft.Azure.Devices.Edge.Agent.IoTHub.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Amqp/Microsoft.Azure.Devices.Edge.Hub.Amqp.csproj b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Amqp/Microsoft.Azure.Devices.Edge.Hub.Amqp.csproj index 4eba5ff6443..9997e4cbe38 100644 --- a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Amqp/Microsoft.Azure.Devices.Edge.Hub.Amqp.csproj +++ b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Amqp/Microsoft.Azure.Devices.Edge.Hub.Amqp.csproj @@ -9,7 +9,7 @@ - + diff --git a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.csproj b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.csproj index 67aae694459..9cb8cfdd9d0 100644 --- a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.csproj +++ b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.CloudProxy/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.csproj @@ -9,7 +9,7 @@ - + diff --git a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Core/Microsoft.Azure.Devices.Edge.Hub.Core.csproj b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Core/Microsoft.Azure.Devices.Edge.Hub.Core.csproj index 1d4f464fcd0..43470918364 100644 --- a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Core/Microsoft.Azure.Devices.Edge.Hub.Core.csproj +++ b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Core/Microsoft.Azure.Devices.Edge.Hub.Core.csproj @@ -18,7 +18,7 @@ - + diff --git a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Http/Microsoft.Azure.Devices.Edge.Hub.Http.csproj b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Http/Microsoft.Azure.Devices.Edge.Hub.Http.csproj index 0eee2ec9781..5c0fe5a4268 100644 --- a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Http/Microsoft.Azure.Devices.Edge.Hub.Http.csproj +++ b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Http/Microsoft.Azure.Devices.Edge.Hub.Http.csproj @@ -13,7 +13,7 @@ - + diff --git a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Service/modules/RoutingModule.cs b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Service/modules/RoutingModule.cs index 8267b423c2a..25494a5eeb7 100644 --- a/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Service/modules/RoutingModule.cs +++ b/edge-hub/core/src/Microsoft.Azure.Devices.Edge.Hub.Service/modules/RoutingModule.cs @@ -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>() diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs index c586c37493f..f1800ac03dd 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs @@ -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()).Create(identity, authenticationMethod, transportSettings); -======= - IClient client = new ClientProvider().Create(identity, authenticationMethod, transportSettings, Option.None()); ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs - + IClient client = new ClientProvider(Option.None()).Create(identity, authenticationMethod, transportSettings, Option.None()); Assert.NotNull(client); Assert.True(client is DeviceClientWrapper); } @@ -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()).Create(identity, authenticationMethod, transportSettings); -======= - IClient client = new ClientProvider().Create(identity, authenticationMethod, transportSettings, Option.None()); ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientProviderTest.cs + IClient client = new ClientProvider(Option.None()).Create(identity, authenticationMethod, transportSettings, Option.None()); Assert.NotNull(client); Assert.True(client is ModuleClientWrapper); @@ -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()); + IClient client = new ClientProvider(Option.None()).Create(identity, tokenProvider, transportSettings, Option.None()); Assert.NotNull(client); Assert.True(client is ModuleClientWrapper); @@ -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()); + IClient client = new ClientProvider(Option.None()).Create(identity, tokenProvider, transportSettings, Option.None()); Assert.NotNull(client); Assert.True(client is DeviceClientWrapper); @@ -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()).Create(identity, tokenProvider, transportSettings, Option.Some(modelId)); Assert.NotNull(client); Assert.True(client is ModuleClientWrapper); @@ -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()).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); @@ -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(() => new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.Some(modelId))); + Assert.Throws(() => new ClientProvider(Option.None()).Create(identity, tokenProvider, transportSettings, Option.Some(modelId))); } [Fact] @@ -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(() => new ClientProvider().Create(identity, tokenProvider, transportSettings, Option.Some(modelId))); + Assert.Throws(() => new ClientProvider(Option.None()).Create(identity, tokenProvider, transportSettings, Option.Some(modelId))); } } } diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientTokenCloudConnectionTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientTokenCloudConnectionTest.cs index 3f65f44cf57..056cb526686 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientTokenCloudConnectionTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/ClientTokenCloudConnectionTest.cs @@ -447,11 +447,8 @@ IClient GetMockedDeviceClient() false, Option.None(), 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()); var deviceConnectivityManager = Mock.Of(); IConnectionManager connectionManager = new ConnectionManager(cloudConnectionProvider, Mock.Of(), new IdentityProvider(hostname), deviceConnectivityManager); diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs index 9e6ca3dd97f..64fa4af098f 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.CloudProxy.Test/CloudConnectionProviderTest.cs @@ -148,11 +148,8 @@ public async Task ConnectUsingTokenCredentialsTest() false, Option.None(), 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(m => m.Id == "d1"); @@ -203,11 +200,8 @@ public async Task ConnectUsingInvalidTokenCredentialsTest() false, Option.None(), 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(m => m.Id == "d1"); @@ -255,11 +249,8 @@ public async Task ConnectUsingIdentityInScopeTest() false, Option.None(), 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 @@ -306,11 +297,8 @@ public async Task ConnectUsingIdentityInCacheTest() false, Option.None(), 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 @@ -357,11 +345,8 @@ public async Task ConnectUsingIdentityInCacheTest2() false, Option.None(), 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 diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs index 65e7d3bdc0a..2b03d7996cb 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs @@ -1028,14 +1028,9 @@ public async Task TestCloseDeviceAndCloudConnection(bool closeCloudConnectionOnD ICredentialsCache credentialsCache = new CredentialsCache(new NullCredentialsCache()); await credentialsCache.Add(module1Credentials); var productInfoStore = Mock.Of(); -<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs - var deviceScopeIdentitiesCache = new Mock(); deviceScopeIdentitiesCache.Setup(d => d.GetAuthChain(It.Is(i => i == module1Credentials.Identity.Id))).ReturnsAsync(Option.Some(module1Credentials.Identity.Id)); - -======= var modelIdStore = Mock.Of(); ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/ConnectionManagerTest.cs var cloudConnectionProvider = new CloudConnectionProvider( messageConverterProvider, 1, diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs index 2d02d538716..37b25e527f8 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Core.Test/RetryingCloudProxyTest.cs @@ -87,11 +87,8 @@ public async Task TestSendMessages() false, Option.None(), 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(); @@ -196,11 +193,8 @@ public async Task TestGetTwin() false, Option.None(), 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(); @@ -289,11 +283,8 @@ public async Task TestMultipleOperations() false, Option.None(), 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(); diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs index f22874e5577..061449b1d04 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs @@ -95,40 +95,6 @@ public static IEnumerable GetIdentityProviderInputs() }; } -<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs -======= - public static IEnumerable GetUsernames() - { - yield return new object[] { "iotHub1/device1/api-version=2010-01-01&DeviceClientType=customDeviceClient1", "device1", string.Empty, "customDeviceClient1", string.Empty }; - - yield return new object[] { "iotHub1/device1/module1/api-version=2010-01-01&DeviceClientType=customDeviceClient2", "device1", "module1", "customDeviceClient2", string.Empty }; - - yield return new object[] { "iotHub1/device1/module1/api-version=2017-06-30/DeviceClientType=Microsoft.Azure.Devices.Client/1.5.1-preview-003", "device1", "module1", "Microsoft.Azure.Devices.Client/1.5.1-preview-003", string.Empty }; - - yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1", "device1", string.Empty, "customDeviceClient1", string.Empty }; - - yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1&model-id=testModelId", "device1", string.Empty, "customDeviceClient1", "testModelId" }; - - yield return new object[] { "iotHub1/device1/module1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1", "device1", "module1", "customDeviceClient1", string.Empty }; - - yield return new object[] { "iotHub1/device1/module1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1&model-id=testModelId", "device1", "module1", "customDeviceClient1", "testModelId" }; - - yield return new object[] { "iotHub1/device1/api-version=2010-01-01&DeviceClientType1=customDeviceClient1", "device1", string.Empty, string.Empty, string.Empty }; - - yield return new object[] { "iotHub1/device1/api-version=2010-01-01&DeviceClientType1=customDeviceClient1&model-id=testModelId", "device1", string.Empty, string.Empty, "testModelId" }; - - yield return new object[] { "iotHub1/device1/module1/api-version=2010-01-01&", "device1", "module1", string.Empty, string.Empty }; - - yield return new object[] { "iotHub1/device1/module1/api-version=2010-01-01&model-id=testModelId", "device1", "module1", string.Empty, "testModelId" }; - - yield return new object[] { "iotHub1/device1/?api-version=2010-01-01", "device1", string.Empty, string.Empty, string.Empty }; - - yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&model-id=testModelId", "device1", string.Empty, string.Empty, "testModelId" }; - - yield return new object[] { "iotHub1/device1/module1/?api-version=2010-01-01&Foo=customDeviceClient1", "device1", "module1", string.Empty, string.Empty }; - } - ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs [Theory] [Integration] [MemberData(nameof(GetIdentityProviderInputs))] @@ -146,11 +112,7 @@ public async Task GetDeviceIdentityTest( var productInfoStore = Mock.Of(); var modelIdStore = Mock.Of(); authenticator.Setup(a => a.AuthenticateAsync(It.IsAny())).ReturnsAsync(authRetVal); -<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs - var deviceIdentityProvider = new DeviceIdentityProvider(authenticator.Object, new MqttUsernameParser(), new ClientCredentialsFactory(new IdentityProvider(iotHubHostName)), productInfoStore, true); -======= - var deviceIdentityProvider = new DeviceIdentityProvider(authenticator.Object, new ClientCredentialsFactory(new IdentityProvider(iotHubHostName)), productInfoStore, modelIdStore, true); ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs + var deviceIdentityProvider = new DeviceIdentityProvider(authenticator.Object, new MqttUsernameParser(), new ClientCredentialsFactory(new IdentityProvider(iotHubHostName)), productInfoStore, modelIdStore, true); if (certificate != null) { deviceIdentityProvider.RegisterConnectionCertificate(certificate, chain); @@ -160,45 +122,6 @@ public async Task GetDeviceIdentityTest( Assert.IsAssignableFrom(expectedType, deviceIdentity); } -<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs -======= - [Theory] - [MemberData(nameof(GetUsernames))] - [Unit] - public void ParseUsernameTest(string username, string expectedDeviceId, string expectedModuleId, string expectedDeviceClientType, string expectedModelId) - { - (string deviceId, string moduleId, string deviceClientType, Option modelId) = DeviceIdentityProvider.ParseUserName(username); - Assert.Equal(expectedDeviceId, deviceId); - Assert.Equal(expectedModuleId, moduleId); - Assert.Equal(expectedDeviceClientType, deviceClientType); - if (!string.IsNullOrEmpty(expectedModelId)) - { - Assert.True(modelId.HasValue); - } - - modelId.ForEach(mId => Assert.Equal(expectedModelId, mId)); - } - - [Theory] - [InlineData("iotHub1/device1")] - [InlineData("iotHub1/device1/fooBar")] - [InlineData("iotHub1/device1/api-version")] - [InlineData("iotHub1/device1/module1/fooBar")] - [InlineData("iotHub1/device1/module1/api-version")] - [InlineData("iotHub1/device1/module1/api-version=2017-06-30/DeviceClientType=Microsoft.Azure.Devices.Client/1.5.1-preview-003/prodInfo")] - [InlineData("iotHub1/device1/module1/api-version=2017-06-30/DeviceClientType=Microsoft.Azure.Devices.Client")] - [InlineData("iotHub1/device1/module1")] - [InlineData("iotHub1/device1/module1?api-version=2010-01-01?DeviceClientType=customDeviceClient1")] - [InlineData("iotHub1?api-version=2010-01-01&DeviceClientType=customDeviceClient1")] - [InlineData("iotHub1/device1/module1/?version=2010-01-01&DeviceClientType=customDeviceClient1")] - [InlineData("iotHub1//?api-version=2010-01-01&DeviceClientType=customDeviceClient1")] - [Unit] - public void ParseUserNameErrorTest(string username) - { - Assert.Throws(() => DeviceIdentityProvider.ParseUserName(username)); - } - ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs [Fact] [Unit] public async Task GetIdentityCertAuthNotEnabled() @@ -208,11 +131,7 @@ public async Task GetIdentityCertAuthNotEnabled() var productInfoStore = Mock.Of(); var modelIdStore = Mock.Of(); authenticator.Setup(a => a.AuthenticateAsync(It.IsAny())).ReturnsAsync(true); -<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs - var deviceIdentityProvider = new DeviceIdentityProvider(authenticator.Object, new MqttUsernameParser(), new ClientCredentialsFactory(new IdentityProvider(iotHubHostName)), productInfoStore, false); -======= - var deviceIdentityProvider = new DeviceIdentityProvider(authenticator.Object, new ClientCredentialsFactory(new IdentityProvider(iotHubHostName)), productInfoStore, modelIdStore, false); ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/DeviceIdentityProviderTest.cs + var deviceIdentityProvider = new DeviceIdentityProvider(authenticator.Object, new MqttUsernameParser(), new ClientCredentialsFactory(new IdentityProvider(iotHubHostName)), productInfoStore, modelIdStore, false); deviceIdentityProvider.RegisterConnectionCertificate(new X509Certificate2(), new List { new X509Certificate2() }); IDeviceIdentity deviceIdentity = await deviceIdentityProvider.GetAsync( "Device_2", diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/IdentityTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/IdentityTest.cs index 51bdfe84e9f..95b152ea70f 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/IdentityTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/IdentityTest.cs @@ -324,11 +324,7 @@ static async Task GetClientCredentials(string iotHubHostName var authenticator = Mock.Of(a => a.AuthenticateAsync(It.IsAny()) == Task.FromResult(true)); var usernameParser = new MqttUsernameParser(); var factory = new ClientCredentialsFactory(new IdentityProvider(iotHubHostName), productInfo); -<<<<<<< HEAD:edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/IdentityTest.cs - var credentialIdentityProvider = new DeviceIdentityProvider(authenticator, usernameParser, factory, productInfoStore, isCertAuthAllowed); -======= - var credentialIdentityProvider = new DeviceIdentityProvider(authenticator, factory, productInfoStore, modelIdStore, isCertAuthAllowed); ->>>>>>> master:edge-hub/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/IdentityTest.cs + var credentialIdentityProvider = new DeviceIdentityProvider(authenticator, usernameParser, factory, productInfoStore, modelIdStore, isCertAuthAllowed); if (certificate != null && chain != null) { credentialIdentityProvider.RegisterConnectionCertificate(certificate, chain); diff --git a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/MqttUsernameParserTest.cs b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/MqttUsernameParserTest.cs index ff4b8e179f6..3498fa78257 100644 --- a/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/MqttUsernameParserTest.cs +++ b/edge-hub/core/test/Microsoft.Azure.Devices.Edge.Hub.Mqtt.Test/MqttUsernameParserTest.cs @@ -19,23 +19,23 @@ public static IEnumerable GetUsernames() yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1", "device1", string.Empty, "customDeviceClient1", string.Empty }; - yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1&digital-twin-model-id=testModelId", "device1", string.Empty, "customDeviceClient1", "testModelId" }; + yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1&model-id=testModelId", "device1", string.Empty, "customDeviceClient1", "testModelId" }; yield return new object[] { "iotHub1/device1/module1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1", "device1", "module1", "customDeviceClient1", string.Empty }; - yield return new object[] { "iotHub1/device1/module1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1&digital-twin-model-id=testModelId", "device1", "module1", "customDeviceClient1", "testModelId" }; + yield return new object[] { "iotHub1/device1/module1/?api-version=2010-01-01&DeviceClientType=customDeviceClient1&model-id=testModelId", "device1", "module1", "customDeviceClient1", "testModelId" }; yield return new object[] { "iotHub1/device1/api-version=2010-01-01&DeviceClientType1=customDeviceClient1", "device1", string.Empty, string.Empty, string.Empty }; - yield return new object[] { "iotHub1/device1/api-version=2010-01-01&DeviceClientType1=customDeviceClient1&digital-twin-model-id=testModelId", "device1", string.Empty, string.Empty, "testModelId" }; + yield return new object[] { "iotHub1/device1/api-version=2010-01-01&DeviceClientType1=customDeviceClient1&model-id=testModelId", "device1", string.Empty, string.Empty, "testModelId" }; yield return new object[] { "iotHub1/device1/module1/api-version=2010-01-01&", "device1", "module1", string.Empty, string.Empty }; - yield return new object[] { "iotHub1/device1/module1/api-version=2010-01-01&digital-twin-model-id=testModelId", "device1", "module1", string.Empty, "testModelId" }; + yield return new object[] { "iotHub1/device1/module1/api-version=2010-01-01&model-id=testModelId", "device1", "module1", string.Empty, "testModelId" }; yield return new object[] { "iotHub1/device1/?api-version=2010-01-01", "device1", string.Empty, string.Empty, string.Empty }; - yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&digital-twin-model-id=testModelId", "device1", string.Empty, string.Empty, "testModelId" }; + yield return new object[] { "iotHub1/device1/?api-version=2010-01-01&model-id=testModelId", "device1", string.Empty, string.Empty, "testModelId" }; yield return new object[] { "iotHub1/device1/module1/?api-version=2010-01-01&Foo=customDeviceClient1", "device1", "module1", string.Empty, string.Empty }; } diff --git a/edge-modules/MetricsCollector/MetricsCollector.csproj b/edge-modules/MetricsCollector/MetricsCollector.csproj index 6291735ab0d..c681bc9e3d3 100644 --- a/edge-modules/MetricsCollector/MetricsCollector.csproj +++ b/edge-modules/MetricsCollector/MetricsCollector.csproj @@ -14,7 +14,7 @@ - + diff --git a/edge-modules/SimulatedTemperatureSensor/SimulatedTemperatureSensor.csproj b/edge-modules/SimulatedTemperatureSensor/SimulatedTemperatureSensor.csproj index 2369e4dca72..af1d020b1fb 100644 --- a/edge-modules/SimulatedTemperatureSensor/SimulatedTemperatureSensor.csproj +++ b/edge-modules/SimulatedTemperatureSensor/SimulatedTemperatureSensor.csproj @@ -14,7 +14,7 @@ - + diff --git a/edge-modules/functions/binding/src/Microsoft.Azure.WebJobs.Extensions.EdgeHub/Microsoft.Azure.WebJobs.Extensions.EdgeHub.csproj b/edge-modules/functions/binding/src/Microsoft.Azure.WebJobs.Extensions.EdgeHub/Microsoft.Azure.WebJobs.Extensions.EdgeHub.csproj index d971b6b07ec..e8431e464bd 100644 --- a/edge-modules/functions/binding/src/Microsoft.Azure.WebJobs.Extensions.EdgeHub/Microsoft.Azure.WebJobs.Extensions.EdgeHub.csproj +++ b/edge-modules/functions/binding/src/Microsoft.Azure.WebJobs.Extensions.EdgeHub/Microsoft.Azure.WebJobs.Extensions.EdgeHub.csproj @@ -25,7 +25,7 @@ - + diff --git a/samples/dotnet/EdgeDownstreamDevice/EdgeDownstreamDevice.csproj b/samples/dotnet/EdgeDownstreamDevice/EdgeDownstreamDevice.csproj index f25ac0ef243..a39cf150da6 100644 --- a/samples/dotnet/EdgeDownstreamDevice/EdgeDownstreamDevice.csproj +++ b/samples/dotnet/EdgeDownstreamDevice/EdgeDownstreamDevice.csproj @@ -9,6 +9,6 @@ - + diff --git a/samples/dotnet/EdgeX509AuthDownstreamDevice/EdgeX509AuthDownstreamDevice.csproj b/samples/dotnet/EdgeX509AuthDownstreamDevice/EdgeX509AuthDownstreamDevice.csproj index ecb88fc6c33..c5c527c152d 100644 --- a/samples/dotnet/EdgeX509AuthDownstreamDevice/EdgeX509AuthDownstreamDevice.csproj +++ b/samples/dotnet/EdgeX509AuthDownstreamDevice/EdgeX509AuthDownstreamDevice.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ - + diff --git a/smoke/IotEdgeQuickstart/IotEdgeQuickstart.csproj b/smoke/IotEdgeQuickstart/IotEdgeQuickstart.csproj index 0d082fdd520..f98b585c639 100644 --- a/smoke/IotEdgeQuickstart/IotEdgeQuickstart.csproj +++ b/smoke/IotEdgeQuickstart/IotEdgeQuickstart.csproj @@ -10,7 +10,7 @@ - + diff --git a/smoke/LeafDevice/LeafDevice.csproj b/smoke/LeafDevice/LeafDevice.csproj index 408b8a07716..e91b0fa529f 100644 --- a/smoke/LeafDevice/LeafDevice.csproj +++ b/smoke/LeafDevice/LeafDevice.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/Microsoft.Azure.Devices.Edge.Test.Common.csproj b/test/Microsoft.Azure.Devices.Edge.Test.Common/Microsoft.Azure.Devices.Edge.Test.Common.csproj index df2889a09d8..8f083eb5b18 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/Microsoft.Azure.Devices.Edge.Test.Common.csproj +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/Microsoft.Azure.Devices.Edge.Test.Common.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/test/modules/CloudToDeviceMessageTester/CloudToDeviceMessageTester.csproj b/test/modules/CloudToDeviceMessageTester/CloudToDeviceMessageTester.csproj index ac6350e6eb4..624bfb8d72e 100644 --- a/test/modules/CloudToDeviceMessageTester/CloudToDeviceMessageTester.csproj +++ b/test/modules/CloudToDeviceMessageTester/CloudToDeviceMessageTester.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/test/modules/DeploymentTester/DeploymentTester.csproj b/test/modules/DeploymentTester/DeploymentTester.csproj index 3e72f74eb61..fb885ce9809 100644 --- a/test/modules/DeploymentTester/DeploymentTester.csproj +++ b/test/modules/DeploymentTester/DeploymentTester.csproj @@ -14,7 +14,7 @@ - + diff --git a/test/modules/DirectMethodReceiver/DirectMethodReceiver.csproj b/test/modules/DirectMethodReceiver/DirectMethodReceiver.csproj index 4d11d2168f8..6ed15cfcd47 100644 --- a/test/modules/DirectMethodReceiver/DirectMethodReceiver.csproj +++ b/test/modules/DirectMethodReceiver/DirectMethodReceiver.csproj @@ -13,7 +13,7 @@ - + diff --git a/test/modules/DirectMethodSender/DirectMethodSender.csproj b/test/modules/DirectMethodSender/DirectMethodSender.csproj index 65d80826d0f..16b2845726a 100644 --- a/test/modules/DirectMethodSender/DirectMethodSender.csproj +++ b/test/modules/DirectMethodSender/DirectMethodSender.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/test/modules/EdgeHubRestartTester/EdgeHubRestartTester.csproj b/test/modules/EdgeHubRestartTester/EdgeHubRestartTester.csproj index a8cf2d68a21..2d10f5fe350 100644 --- a/test/modules/EdgeHubRestartTester/EdgeHubRestartTester.csproj +++ b/test/modules/EdgeHubRestartTester/EdgeHubRestartTester.csproj @@ -27,8 +27,8 @@ - - + + diff --git a/test/modules/MetricsValidator/MetricsValidator.csproj b/test/modules/MetricsValidator/MetricsValidator.csproj index ed17212ca31..407748b7ad4 100644 --- a/test/modules/MetricsValidator/MetricsValidator.csproj +++ b/test/modules/MetricsValidator/MetricsValidator.csproj @@ -14,7 +14,7 @@ - + diff --git a/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj b/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj index ff1a1afddbc..09d8436d71a 100644 --- a/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj +++ b/test/modules/ModuleLib/Microsoft.Azure.Devices.Edge.ModuleUtil.csproj @@ -3,7 +3,7 @@ - + diff --git a/test/modules/ModuleRestarter/ModuleRestarter.csproj b/test/modules/ModuleRestarter/ModuleRestarter.csproj index f7669996c5d..6f42b1a1e03 100644 --- a/test/modules/ModuleRestarter/ModuleRestarter.csproj +++ b/test/modules/ModuleRestarter/ModuleRestarter.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/test/modules/Relayer/Relayer.csproj b/test/modules/Relayer/Relayer.csproj index 6ab0adda414..69c3aca096a 100644 --- a/test/modules/Relayer/Relayer.csproj +++ b/test/modules/Relayer/Relayer.csproj @@ -14,7 +14,7 @@ - + diff --git a/test/modules/TemperatureFilter/TemperatureFilter.csproj b/test/modules/TemperatureFilter/TemperatureFilter.csproj index 4777fc30396..9653a5261b3 100644 --- a/test/modules/TemperatureFilter/TemperatureFilter.csproj +++ b/test/modules/TemperatureFilter/TemperatureFilter.csproj @@ -14,7 +14,7 @@ - + diff --git a/test/modules/TestAnalyzer/TestAnalyzer.csproj b/test/modules/TestAnalyzer/TestAnalyzer.csproj index 7fed8ec4496..0c781282055 100644 --- a/test/modules/TestAnalyzer/TestAnalyzer.csproj +++ b/test/modules/TestAnalyzer/TestAnalyzer.csproj @@ -19,7 +19,7 @@ - + diff --git a/test/modules/TestResultCoordinator/TestResultCoordinator.csproj b/test/modules/TestResultCoordinator/TestResultCoordinator.csproj index 92e77196b15..a920cad2001 100644 --- a/test/modules/TestResultCoordinator/TestResultCoordinator.csproj +++ b/test/modules/TestResultCoordinator/TestResultCoordinator.csproj @@ -20,7 +20,7 @@ - + diff --git a/test/modules/TwinTester/TwinTester.csproj b/test/modules/TwinTester/TwinTester.csproj index 5c6894b377d..c8a19acb14f 100644 --- a/test/modules/TwinTester/TwinTester.csproj +++ b/test/modules/TwinTester/TwinTester.csproj @@ -14,8 +14,8 @@ - - + + diff --git a/test/modules/load-gen/load-gen.csproj b/test/modules/load-gen/load-gen.csproj index bfc31fe0331..fd3299180a8 100644 --- a/test/modules/load-gen/load-gen.csproj +++ b/test/modules/load-gen/load-gen.csproj @@ -15,7 +15,7 @@ - +