Skip to content

Commit 514785c

Browse files
travis-ci build fix
1 parent d9e97be commit 514785c

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

src/ResourceManager/Common/Commands.TestFw/TestManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ protected void SetupAzureContext()
235235
const string tenantIdKey = "TenantId";
236236
const string domainKey = "Domain";
237237
const string subscriptionIdKey = "SubscriptionId";
238-
const string zeroGuild = "00000000-0000-0000-0000-000000000000";
239238
const string undefined = "Undefined";
239+
var zeroGuild = Guid.Empty.ToString();
240240

241241
string tenantId = null;
242242
string userDomain = null;

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/TestManagerBuilder.cs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
using System.Collections.Generic;
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Collections.Generic;
217
using System.Linq;
318
using System.Net.Http;
419
using System.Net.Http.Headers;
@@ -10,7 +25,6 @@
1025
using Microsoft.Azure.Test.HttpRecorder;
1126
using Microsoft.Rest;
1227
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
13-
using Microsoft.WindowsAzure.Commands.ScenarioTest;
1428
using Xunit.Abstractions;
1529

1630
namespace Microsoft.Azure.Commands.Resources.Test.ScenarioTests
@@ -43,10 +57,13 @@ protected TestManagerBuilder(ITestOutputHelper output)
4357
.Build();
4458

4559
var testEnvironment = TestEnvironmentFactory.GetTestEnvironment();
46-
47-
var credentials = new SubscriptionCloudCredentialsAdapter(
48-
testEnvironment.TokenInfo[TokenAudience.Management],
49-
testEnvironment.SubscriptionId);
60+
var credentials = HttpMockServer.Mode == HttpRecorderMode.Record
61+
? new SubscriptionCloudCredentialsAdapter(
62+
testEnvironment.TokenInfo[TokenAudience.Management],
63+
testEnvironment.SubscriptionId)
64+
: new SubscriptionCloudCredentialsAdapter(
65+
new TokenCredentials("foo"),
66+
Guid.Empty.ToString());
5067

5168
HttpClientHelperFactory.Instance = new TestHttpClientHelperFactory(credentials);
5269
}

0 commit comments

Comments
 (0)