tests passing

This commit is contained in:
TomPallister 2020-11-30 11:27:37 +00:00
parent 32551624bb
commit 17b0555f55
4 changed files with 368 additions and 367 deletions

View File

@ -28,6 +28,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="3.0.1" />
<PackageReference Include="Steeltoe.Discovery.Eureka" Version="3.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.164">
<PrivateAssets>all</PrivateAssets>
</PackageReference>

View File

@ -1,6 +1,6 @@
namespace Ocelot.AcceptanceTests
{
using Configuration.File;
using Ocelot.Configuration.File;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using Steeltoe.Common.Discovery;
@ -38,24 +38,24 @@
var configuration = new FileConfiguration
{
Routes = new List<FileRoute>
{
new FileRoute
{
new FileRoute
{
DownstreamPathTemplate = "/",
DownstreamScheme = "http",
UpstreamPathTemplate = "/",
UpstreamHttpMethod = new List<string> { "Get" },
ServiceName = serviceName,
LoadBalancerOptions = new FileLoadBalancerOptions { Type = "LeastConnection" },
}
DownstreamPathTemplate = "/",
DownstreamScheme = "http",
UpstreamPathTemplate = "/",
UpstreamHttpMethod = new List<string> { "Get" },
ServiceName = serviceName,
LoadBalancerOptions = new FileLoadBalancerOptions { Type = "LeastConnection" },
},
},
GlobalConfiguration = new FileGlobalConfiguration()
{
ServiceDiscoveryProvider = new FileServiceDiscoveryProvider()
{
Type = "Eureka"
}
}
Type = "Eureka",
},
},
};
this.Given(x => x.GivenEurekaProductServiceOneIsRunning(downstreamServiceOneUrl))
@ -91,42 +91,42 @@
{
name = serviceName,
instance = new List<Instance>
{
new Instance
{
instanceId = $"{serviceInstance.Host}:{serviceInstance}",
hostName = serviceInstance.Host,
app = serviceName,
ipAddr = "127.0.0.1",
status = "UP",
overriddenstatus = "UNKNOWN",
port = new Port {value = serviceInstance.Port, enabled = "true"},
securePort = new SecurePort {value = serviceInstance.Port, enabled = "true"},
countryId = 1,
dataCenterInfo = new DataCenterInfo {value = "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo", name = "MyOwn"},
leaseInfo = new LeaseInfo
{
new Instance
{
instanceId = $"{serviceInstance.Host}:{serviceInstance}",
hostName = serviceInstance.Host,
app = serviceName,
ipAddr = "127.0.0.1",
status = "UP",
overriddenstatus = "UNKNOWN",
port = new Port {value = serviceInstance.Port, enabled = "true"},
securePort = new SecurePort {value = serviceInstance.Port, enabled = "true"},
countryId = 1,
dataCenterInfo = new DataCenterInfo {value = "com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo", name = "MyOwn"},
leaseInfo = new LeaseInfo
{
renewalIntervalInSecs = 30,
durationInSecs = 90,
registrationTimestamp = 1457714988223,
lastRenewalTimestamp= 1457716158319,
evictionTimestamp = 0,
serviceUpTimestamp = 1457714988223
},
metadata = new Metadata
{
value = "java.util.Collections$EmptyMap"
},
homePageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
statusPageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
healthCheckUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
vipAddress = serviceName,
isCoordinatingDiscoveryServer = "false",
lastUpdatedTimestamp = "1457714988223",
lastDirtyTimestamp = "1457714988172",
actionType = "ADDED"
}
}
renewalIntervalInSecs = 30,
durationInSecs = 90,
registrationTimestamp = 1457714988223,
lastRenewalTimestamp= 1457716158319,
evictionTimestamp = 0,
serviceUpTimestamp = 1457714988223,
},
metadata = new Metadata
{
value = "java.util.Collections$EmptyMap",
},
homePageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
statusPageUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
healthCheckUrl = $"{serviceInstance.Host}:{serviceInstance.Port}",
vipAddress = serviceName,
isCoordinatingDiscoveryServer = "false",
lastUpdatedTimestamp = "1457714988223",
lastDirtyTimestamp = "1457714988172",
actionType = "ADDED",
},
},
};
apps.Add(a);
@ -138,8 +138,8 @@
{
application = apps,
apps__hashcode = "UP_1_",
versions__delta = "1"
}
versions__delta = "1",
},
};
var json = JsonConvert.SerializeObject(applications);