Skip to content

Commit e1b5d68

Browse files
author
Nate Malubay
committed
Fix failing unit tests
1 parent 55d6fe2 commit e1b5d68

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

src/Microsoft.Health.Fhir.Shared.Api.UnitTests/Features/Security/SecurityProviderTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public void GivenSecurityNotEnabled_WhenBuildCalled_SecurityNotAddedToBuilder()
7575

7676
[Theory]
7777
[InlineData(null, null)]
78-
[InlineData(null, "https://localhost:44312/token")]
79-
[InlineData("https://localhost:44312/auth", null)]
78+
[InlineData(null, "https://testhost:44312/token")]
79+
[InlineData("https://testhost:44312/auth", null)]
8080
public void GivenOAuthAuthorizationEndpointOrTokenEndpointIsInvalid_WhenBuildCalled_ExceptionThrown(string auth, string token)
8181
{
8282
_wellKnownConfigurationProvider.GetOpenIdConfigurationAsync(Arg.Any<CancellationToken>()).Returns(GetOpenIdConfiguration(auth, token));
@@ -87,8 +87,8 @@ public void GivenOAuthAuthorizationEndpointOrTokenEndpointIsInvalid_WhenBuildCal
8787
[Fact]
8888
public void GivenOpenIdConfigurationProvided_WhenBuildCalled_ExpectedCapabilitiesAreAdded()
8989
{
90-
string auth = "https://localhost:44312/auth";
91-
string token = "https://localhost:44312/token";
90+
string auth = "https://testhost:44312/auth";
91+
string token = "https://testhost:44312/token";
9292

9393
_modelInfoProvider.Version.Returns(FhirSpecification.R4);
9494
_wellKnownConfigurationProvider.IsSmartConfigured().Returns(false);
@@ -113,11 +113,11 @@ public void GivenOpenIdConfigurationProvided_WhenBuildCalled_ExpectedCapabilitie
113113
}
114114

115115
[Theory]
116-
[InlineData("https://localhost:44312/auth", "https://localhost:44312/token", null, null, null, null)]
117-
[InlineData("https://localhost:44312/auth", "https://localhost:44312/token", "https://localhost:44312/reg", null, null, null)]
118-
[InlineData("https://localhost:44312/auth", "https://localhost:44312/token", "https://localhost:44312/reg", "https://localhost:44312/man", null, null)]
119-
[InlineData("https://localhost:44312/auth", "https://localhost:44312/token", "https://localhost:44312/reg", "https://localhost:44312/man", "https://localhost:44312/intr", null)]
120-
[InlineData("https://localhost:44312/auth", "https://localhost:44312/token", "https://localhost:44312/reg", "https://localhost:44312/man", "https://localhost:44312/intr", "https://localhost:44312/rev")]
116+
[InlineData("https://testhost:44312/auth", "https://testhost:44312/token", null, null, null, null)]
117+
[InlineData("https://testhost:44312/auth", "https://testhost:44312/token", "https://testhost:44312/reg", null, null, null)]
118+
[InlineData("https://testhost:44312/auth", "https://testhost:44312/token", "https://testhost:44312/reg", "https://testhost:44312/man", null, null)]
119+
[InlineData("https://testhost:44312/auth", "https://testhost:44312/token", "https://testhost:44312/reg", "https://testhost:44312/man", "https://testhost:44312/intr", null)]
120+
[InlineData("https://testhost:44312/auth", "https://testhost:44312/token", "https://testhost:44312/reg", "https://testhost:44312/man", "https://testhost:44312/intr", "https://testhost:44312/rev")]
121121
public void GivenSmartConfigurationProvided_WhenBuildCalled_ExpectedCapabilitiesAreAdded(string auth, string token, string reg, string man, string intr, string rev)
122122
{
123123
_modelInfoProvider.Version.Returns(FhirSpecification.R4);
@@ -149,8 +149,8 @@ public void GivenSmartConfigurationProvided_WhenBuildCalled_ExpectedCapabilities
149149
[Fact]
150150
public void GivenSmartConfigurationIsNotValid_WhenBuildCalled_FallbackCapabilitiesAreAdded()
151151
{
152-
string auth = "https://localhost:44312/auth";
153-
string token = "https://localhost:44312/token";
152+
string auth = "https://testhost:44312/auth";
153+
string token = "https://testhost:44312/token";
154154

155155
_modelInfoProvider.Version.Returns(FhirSpecification.R4);
156156
_wellKnownConfigurationProvider.IsSmartConfigured().Returns(true);

src/Microsoft.Health.Fhir.Shared.Core.UnitTests/Features/Conformance/GetSmartConfigurationHandlerTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ public async Task GivenSmartConfigurationProvided_WhenHandleCalled_ThenSmartConf
8383

8484
GetSmartConfigurationResponse response = await _handler.Handle(new GetSmartConfigurationRequest(), CancellationToken.None);
8585

86-
Assert.Equal("https://localhost:44312/smart/auth", response.AuthorizationEndpoint.AbsoluteUri);
87-
Assert.Equal("https://localhost:44312/smart/token", response.TokenEndpoint.AbsoluteUri);
86+
Assert.Equal("https://testhost:44312/smart/auth", response.AuthorizationEndpoint.AbsoluteUri);
87+
Assert.Equal("https://testhost:44312/smart/token", response.TokenEndpoint.AbsoluteUri);
8888
Assert.Equal(capabilities, response.Capabilities);
8989
}
9090

9191
[Fact]
9292
public async Task GivenSmartConfigurationNotProvided_WhenHandleCalled_ThenSmartConfigurationUsingOpenIdReturned()
9393
{
94-
string openIdAuthorization = "https://localhost:44312/openid/auth";
95-
string openIdToken = "https://localhost:44312/openid/token";
94+
string openIdAuthorization = "https://testhost:44312/openid/auth";
95+
string openIdToken = "https://testhost:44312/openid/token";
9696

9797
_configurationProvider.GetOpenIdConfigurationAsync(Arg.Any<CancellationToken>()).Returns(GetOpenIdConfiguration(openIdAuthorization, openIdToken));
9898

@@ -112,8 +112,8 @@ public async Task GivenSmartConfigurationHasNoCapabilities_WhenHandleCalled_Then
112112

113113
GetSmartConfigurationResponse response = await _handler.Handle(new GetSmartConfigurationRequest(), CancellationToken.None);
114114

115-
Assert.Equal("https://localhost:44312/smart/auth", response.AuthorizationEndpoint.AbsoluteUri);
116-
Assert.Equal("https://localhost:44312/smart/token", response.TokenEndpoint.AbsoluteUri);
115+
Assert.Equal("https://testhost:44312/smart/auth", response.AuthorizationEndpoint.AbsoluteUri);
116+
Assert.Equal("https://testhost:44312/smart/token", response.TokenEndpoint.AbsoluteUri);
117117
Assert.Equal(GetFallbackCapabilities(), response.Capabilities);
118118
}
119119

@@ -127,9 +127,9 @@ private GetSmartConfigurationResponse GetSmartConfiguration(List<string> capabil
127127
return new GetSmartConfigurationResponse(
128128
null,
129129
null,
130-
new Uri("https://localhost:44312/smart/auth"),
130+
new Uri("https://testhost:44312/smart/auth"),
131131
null,
132-
new Uri("https://localhost:44312/smart/token"),
132+
new Uri("https://testhost:44312/smart/token"),
133133
null,
134134
null,
135135
null,

src/Microsoft.Health.Fhir.Shared.Core.UnitTests/Features/Conformance/Providers/WellKnownConfigurationProviderTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public WellKnownConfigurationProviderTests()
3535
{
3636
_securityConfiguration = new SecurityConfiguration();
3737
_securityConfiguration.Authorization.Enabled = true;
38-
_securityConfiguration.Authentication.Authority = "https://localhost:44312/OAuth2/v2.0";
39-
_securityConfiguration.SmartAuthentication.Authority = "https://localhost:44312/Smart/OAuth2/v2.0";
38+
_securityConfiguration.Authentication.Authority = "https://testhost:44312/OAuth2/v2.0";
39+
_securityConfiguration.SmartAuthentication.Authority = "https://testhost:44312/Smart/OAuth2/v2.0";
4040

4141
_messageHandler = new TestHttpMessageHandler();
4242
_httpClientFactory = Substitute.For<IHttpClientFactory>();
@@ -198,12 +198,12 @@ private void SetResponseBody(object body, HttpStatusCode code = HttpStatusCode.O
198198

199199
private OpenIdConfigurationResponse GetOpenIdConfiguration()
200200
{
201-
return new OpenIdConfigurationResponse(new Uri("https://localhost:44312/openid/auth"), new Uri("https://localhost:44312/openid/token"));
201+
return new OpenIdConfigurationResponse(new Uri("https://testhost:44312/openid/auth"), new Uri("https://testhost:44312/openid/token"));
202202
}
203203

204204
private GetSmartConfigurationResponse GetSmartConfiguration()
205205
{
206-
return new GetSmartConfigurationResponse(new Uri("https://localhost:44312/smart/auth"), new Uri("https://localhost:44312/smart/token"));
206+
return new GetSmartConfigurationResponse(new Uri("https://testhost:44312/smart/auth"), new Uri("https://testhost:44312/smart/token"));
207207
}
208208

209209
internal class TestHttpMessageHandler : DelegatingHandler

0 commit comments

Comments
 (0)