Skip to content

Commit

Permalink
Fiks for MalwareScanTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Todorov committed Oct 7, 2024
1 parent a94749a commit 94c2960
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/Altinn.Broker.Tests/MalwareScanResultControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Text;
using System.Text.Json;

using Altinn.Broker.API.Models;
using Altinn.Broker.Core.Models;
using Altinn.Broker.Enums;
using Altinn.Broker.Models;
Expand Down Expand Up @@ -89,8 +90,9 @@ private async Task<string> UploadAndCheckFileTransfer()
{
var initializeFileTransferResponse = await _senderClient.PostAsJsonAsync("broker/api/v1/filetransfer", FileTransferInitializeExtTestFactory.BasicFileTransfer());
Assert.True(initializeFileTransferResponse.IsSuccessStatusCode, $"The request failed with status code {initializeFileTransferResponse.StatusCode}. Error message: {await initializeFileTransferResponse.Content.ReadAsStringAsync()}");
var fileTransferId = await initializeFileTransferResponse.Content.ReadAsStringAsync();

var fileTransferResponse = await initializeFileTransferResponse.Content.ReadFromJsonAsync<FileTransferInitializeResponseExt>();
var fileTransferId = fileTransferResponse.FileTransferId.ToString();

Check warning on line 94 in tests/Altinn.Broker.Tests/MalwareScanResultControllerTests.cs

View workflow job for this annotation

GitHub Actions / Test application

Dereference of a possibly null reference.

// Upload
var uploadedFileBytes = Encoding.UTF8.GetBytes("This is the contents of the uploaded file");
using (var content = new ByteArrayContent(uploadedFileBytes))
Expand Down

0 comments on commit 94c2960

Please sign in to comment.