-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into madu/new-incoming-rsm-012-json-parser
- Loading branch information
Showing
20 changed files
with
662 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...Manager.Client.Tests/Integration/BRS_026_028/V1/RequestCalculatedEnergyTimeSeriesTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright 2020 Energinet DataHub A/S | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License2"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using Energinet.DataHub.ProcessManager.Client.Tests.Fixtures; | ||
using Xunit.Abstractions; | ||
|
||
namespace Energinet.DataHub.ProcessManager.Client.Tests.Integration.BRS_026_028.V1; | ||
|
||
/// <summary> | ||
/// Test collection that verifies the Process Manager clients can be used to start a | ||
/// request calculated energy time series orchestration and monitor its status during its lifetime. | ||
/// </summary> | ||
[Collection(nameof(ProcessManagerClientCollection))] | ||
public class RequestCalculatedEnergyTimeSeriesTests : IAsyncLifetime | ||
{ | ||
private readonly ScenarioProcessManagerAppFixture _processManagerAppFixture; | ||
private readonly ScenarioOrchestrationsAppFixture _orchestrationsAppFixture; | ||
|
||
public RequestCalculatedEnergyTimeSeriesTests( | ||
ScenarioProcessManagerAppFixture processManagerAppFixture, | ||
ScenarioOrchestrationsAppFixture orchestrationsAppFixture, | ||
ITestOutputHelper testOutputHelper) | ||
{ | ||
_processManagerAppFixture = processManagerAppFixture; | ||
_orchestrationsAppFixture = orchestrationsAppFixture; | ||
|
||
_processManagerAppFixture.SetTestOutputHelper(testOutputHelper); | ||
_orchestrationsAppFixture.SetTestOutputHelper(testOutputHelper); | ||
} | ||
|
||
public Task InitializeAsync() | ||
{ | ||
_processManagerAppFixture.AppHostManager.ClearHostLog(); | ||
_orchestrationsAppFixture.AppHostManager.ClearHostLog(); | ||
|
||
return Task.CompletedTask; | ||
} | ||
|
||
public Task DisposeAsync() | ||
{ | ||
_processManagerAppFixture.SetTestOutputHelper(null!); | ||
_orchestrationsAppFixture.SetTestOutputHelper(null!); | ||
|
||
return Task.CompletedTask; | ||
} | ||
|
||
[Fact] | ||
public async Task RequestCalculatedEnergyTimeSeries_WhenStartedUsingClient_CanMonitorLifecycle() | ||
{ | ||
// TODO: Implement test after implementation of shared Service Bus topic in app fixtures | ||
// Arrange | ||
// var requestCalculatedDataClient = new RequestCalculatedDataClientV1(); | ||
// var input = new RequestCalculatedDataInputV1<RequestCalculatedEnergyTimeSeriesInputV1>( | ||
// Guid.NewGuid().ToString(), | ||
// new RequestCalculatedEnergyTimeSeriesInputV1("B1337")); | ||
// | ||
// // Act | ||
// await requestCalculatedDataClient.RequestCalculatedEnergyTimeSeriesAsync(input, CancellationToken.None); | ||
|
||
// Assert | ||
await Task.CompletedTask; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
source/ProcessManager.Client/Extensions/Options/ProcessManagerServiceBusClientsOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2020 Energinet DataHub A/S | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License2"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System.ComponentModel.DataAnnotations; | ||
using Microsoft.Extensions.Configuration; | ||
|
||
namespace Energinet.DataHub.ProcessManager.Client.Extensions.Options; | ||
|
||
/// <summary> | ||
/// Options for configuration of Process Manager Service Bus clients using the Process Manager. | ||
/// </summary> | ||
public class ProcessManagerServiceBusClientsOptions | ||
{ | ||
public const string SectionName = "ProcessManagerServiceBusClients"; | ||
|
||
/// <summary> | ||
/// Name of the topic which the Process Manager receives service bus messages on | ||
/// </summary> | ||
[Required] | ||
public string TopicName { get; set; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
source/ProcessManager.Client/Processes/BRS_026_028/V1/IRequestCalculatedDataClientV1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2020 Energinet DataHub A/S | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License2"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using Energinet.DataHub.ProcessManager.Client.Processes.BRS_026_028.V1.Model; | ||
using Energinet.DataHub.ProcessManager.Orchestrations.Processes.BRS_026.V1.Models; | ||
|
||
namespace Energinet.DataHub.ProcessManager.Client.Processes.BRS_026_028.V1; | ||
|
||
/// <summary> | ||
/// Client for the BRS-026/BRS-028 process | ||
/// </summary> | ||
public interface IRequestCalculatedDataClientV1 | ||
{ | ||
/// <summary> | ||
/// Start a request for energy results | ||
/// </summary> | ||
public Task RequestCalculatedEnergyTimeSeriesAsync(RequestCalculatedDataInputV1<RequestCalculatedEnergyTimeSeriesInputV1> input, CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Start a request for wholesale results | ||
/// </summary> | ||
public Task RequestCalculatedWholesaleServicesAsync(RequestCalculatedDataInputV1<object> input, CancellationToken cancellationToken); | ||
} |
20 changes: 20 additions & 0 deletions
20
source/ProcessManager.Client/Processes/BRS_026_028/V1/Model/RequestCalculatedDataInputV1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2020 Energinet DataHub A/S | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License2"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace Energinet.DataHub.ProcessManager.Client.Processes.BRS_026_028.V1.Model; | ||
|
||
public record RequestCalculatedDataInputV1<TInput>( | ||
string MessageId, | ||
TInput Input) | ||
where TInput : class; |
Oops, something went wrong.