Skip to content

Commit 5f8b141

Browse files
author
Espen Gulbrandsen
committed
Add changes based on feedback
1 parent d6b1372 commit 5f8b141

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

src/Events.Functions/Models/LogEntryDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Altinn.Platform.Events.Functions.Models
66
/// <summary>
77
/// Data transfer object for posting a log event after receiving a webhook response.
88
/// </summary>
9-
public record LogEntryDto
9+
public class LogEntryDto
1010
{
1111
/// <summary>
1212
/// The cloud event id associated with the logged event

src/Events/Models/LogEntryDto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Altinn.Platform.Events.Models
99
/// <summary>
1010
/// Data transfer object for posting a log event after receiving a webhook response.
1111
/// </summary>
12-
public record LogEntryDto
12+
public class LogEntryDto
1313
{
1414
/// <summary>
1515
/// The cloud event id associated with the logged event <see cref="CloudEvent"/>"/>

test/Altinn.Platform.Events.Functions.Tests/TestingClients/EventsClientTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ public async Task PostLogEntry_SuccessResponse(string resource)
8787
HttpStatusCode.OK);
8888

8989
var sut = new EventsClient(
90-
new HttpClient(handlerMock.Object),
91-
_atgMock.Object,
92-
_srMock.Object,
93-
_platformSettings,
94-
_loggerMock.Object);
90+
new HttpClient(handlerMock.Object),
91+
_atgMock.Object,
92+
_srMock.Object,
93+
_platformSettings,
94+
_loggerMock.Object);
9595

9696
_cloudEvent["resource"] = resource;
9797

@@ -175,7 +175,7 @@ public async Task PostInbound_NonSuccessResponse_ErrorLoggedAndExceptionThrown()
175175
It.IsAny<EventId>(),
176176
It.Is<It.IsAnyType>((v, t) => v.ToString().Contains("PostInbound event with id 1337 failed with status code ServiceUnavailable")),
177177
It.IsAny<Exception>(),
178-
(Func<It.IsAnyType, Exception, string>)It.IsAny<object>()),
178+
(Func<It.IsAnyType, Exception, string>)It.IsAny<object>()),
179179
Times.Once);
180180
}
181181

@@ -220,7 +220,7 @@ public async Task PostOutbound_NonSuccessResponse_ErrorLoggedAndExceptionThrown(
220220
It.IsAny<EventId>(),
221221
It.Is<It.IsAnyType>((v, t) => v.ToString().Contains("PostOutbound event with id 1337 failed with status code ServiceUnavailable")),
222222
It.IsAny<Exception>(),
223-
(Func<It.IsAnyType, Exception, string>)It.IsAny<object>()),
223+
(Func<It.IsAnyType, Exception, string>)It.IsAny<object>()),
224224
Times.Once);
225225
}
226226

test/Altinn.Platform.Events.Functions.Tests/TestingFunctions/EventsOutboundTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Altinn.Platform.Events.Functions.Clients.Interfaces;
21
using Altinn.Platform.Events.Functions.Models;
32
using Altinn.Platform.Events.Functions.Services.Interfaces;
43

@@ -35,9 +34,8 @@ public async Task Run_ConfirmDeserializationOCloudEventEnvelope_CloudEventPersis
3534
Mock<IWebhookService> webhookServiceMock = new();
3635
webhookServiceMock.Setup(wh => wh.Send(It.Is<CloudEventEnvelope>(cee => cee.CloudEvent != null)))
3736
.Callback<CloudEventEnvelope>(cee => actualServiceInput = cee)
38-
.Returns(Task.FromResult(new HttpResponseMessage()));
37+
.Returns(Task.CompletedTask);
3938

40-
Mock<IEventsClient> eventsClientMock = new();
4139
var sut = new EventsOutbound(webhookServiceMock.Object);
4240

4341
// Act

test/Altinn.Platform.Events.Functions.Tests/TestingFunctions/SubscriptionValidationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public async Task Run_SendWebhookSucceeds_ValidateSubscriptionCalled()
6565
// Arrange
6666
Mock<IWebhookService> webhookServiceMock = new();
6767
webhookServiceMock.Setup(wh => wh.Send(It.IsAny<CloudEventEnvelope>()))
68-
.Returns(Task.FromResult(new HttpResponseMessage()));
68+
.Returns(Task.CompletedTask);
6969

7070
Mock<IEventsClient> clientMock = new();
7171

test/Altinn.Platform.Events.Tests/Models/LogEntryData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Altinn.Platform.Events.Tests.Models
77
/// <summary>
88
/// Data transfer object for posting a log event after receiving a webhook response.
99
/// </summary>
10-
public record LogEntryData
10+
public class LogEntryData
1111
{
1212
/// <summary>
1313
/// The cloud event associated with the post action <see cref="CloudEvent"/>"/>

0 commit comments

Comments
 (0)