Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<DebugType>Full</DebugType>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Moq" Version="4.18.1" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.0.1">
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MediatR" Version="9.0.0" />
<PackageReference Include="SecurityService.Client" Version="1.0.8" />
<PackageReference Include="Shared" Version="1.1.5" />
<PackageReference Include="TransactionProcessor.Client" Version="1.0.17-build79" />
<PackageReference Include="MediatR" Version="10.0.1" />
<PackageReference Include="SecurityService.Client" Version="1.1.1-build9" />
<PackageReference Include="Shared" Version="1.3.3" />
<PackageReference Include="TransactionProcessor.Client" Version="1.1.5-build8" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net5.0|AnyCPU'">
<DocumentationFile>D:\Projects\StuartFerguson\TransactionProcessorACL\TransactionProcessorACL.DataTransferObjects\TransactionProcessorACL.DataTransferObjects.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2-beta1" />
</ItemGroup>

</Project>
75 changes: 6 additions & 69 deletions TransactionProcessorACL.IntegrationTests/Common/DockerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,79 +268,16 @@ public override async Task StartContainersForScenarioRun(String scenarioName)
this.HttpClient = new HttpClient();
this.HttpClient.BaseAddress = new Uri(TransactionProcessorAclBaseAddressResolver(string.Empty));

await this.LoadEventStoreProjections().ConfigureAwait(false);
}

private static EventStoreClientSettings ConfigureEventStoreSettings(Int32 eventStoreHttpPort)
{
String connectionString = $"http://127.0.0.1:{eventStoreHttpPort}";

EventStoreClientSettings settings = new EventStoreClientSettings();
settings.CreateHttpMessageHandler = () => new SocketsHttpHandler
{
SslOptions =
{
RemoteCertificateValidationCallback = (sender,
certificate,
chain,
errors) => true,
}
};
settings.ConnectionName = "Specflow";
settings.ConnectivitySettings = new EventStoreClientConnectivitySettings
{
Insecure = true,
Address = new Uri(connectionString),
};

settings.DefaultCredentials = new UserCredentials("admin", "changeit");
return settings;
}

private async Task LoadEventStoreProjections()
{
//Start our Continous Projections - we might decide to do this at a different stage, but now lets try here
String projectionsFolder = "../../../projections/continuous";
IPAddress[] ipAddresses = Dns.GetHostAddresses("127.0.0.1");

if (!String.IsNullOrWhiteSpace(projectionsFolder))
{
DirectoryInfo di = new DirectoryInfo(projectionsFolder);

if (di.Exists)
{
FileInfo[] files = di.GetFiles();

EventStoreProjectionManagementClient projectionClient = new EventStoreProjectionManagementClient(ConfigureEventStoreSettings(this.EventStoreHttpPort));

foreach (FileInfo file in files)
{
String projection = File.ReadAllText(file.FullName);
String projectionName = file.Name.Replace(".js", String.Empty);

try
{
Logger.LogInformation($"Creating projection [{projectionName}]");
await projectionClient.CreateContinuousAsync(projectionName, projection, trackEmittedStreams:true).ConfigureAwait(false);
}
catch (Exception e)
{
Logger.LogError(new Exception($"Projection [{projectionName}] error", e));
}
}
}
}

Logger.LogInformation("Loaded projections");
await this.LoadEventStoreProjections(this.EventStoreHttpPort).ConfigureAwait(false);
}

public async Task PopulateSubscriptionServiceConfiguration(String estateName)
{
EventStorePersistentSubscriptionsClient client = new EventStorePersistentSubscriptionsClient(ConfigureEventStoreSettings(this.EventStoreHttpPort));

PersistentSubscriptionSettings settings = new PersistentSubscriptionSettings(resolveLinkTos: true, StreamPosition.Start);
await client.CreateAsync(estateName.Replace(" ", ""), "Reporting", settings);
await client.CreateAsync($"EstateManagementSubscriptionStream_{estateName.Replace(" ", "")}", "Estate Management", settings);
List<(String streamName, String groupName, Int32 maxRetries)> subscriptions = new List<(String streamName, String groupName, Int32 maxRetries)>();
subscriptions.Add((estateName.Replace(" ", ""), "Reporting", 5));
subscriptions.Add(($"EstateManagementSubscriptionStream_{estateName.Replace(" ", "")}", "Estate Management", 0));
subscriptions.Add(($"TransactionProcessorSubscriptionStream_{estateName.Replace(" ", "")}", "Transaction Processor", 0));
await this.PopulateSubscriptionServiceConfiguration(this.EventStoreHttpPort, subscriptions);
}

private async Task RemoveEstateReadModel()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading