Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding accession Id filtering for counts #1012

Merged
merged 2 commits into from
Jul 5, 2024
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
4 changes: 3 additions & 1 deletion src/WorkflowManager/Common/Interfaces/IPaginatedApi.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
* limitations under the License.
*/

using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces
{
public interface IPaginatedApi<T>
{
Task<long> CountAsync();
Task<long> CountAsync(FilterDefinition<T>? filter = null);

Task<IList<T>> GetAllAsync(int? skip = null, int? limit = null);
}
Expand Down
8 changes: 6 additions & 2 deletions src/WorkflowManager/Common/Interfaces/IPayloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

using Monai.Deploy.Messaging.Events;
using Monai.Deploy.WorkflowManager.Common.Contracts.Models;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces
{
Expand All @@ -38,8 +39,9 @@ public interface IPayloadService : IPaginatedApi<PayloadDto>
/// </summary>
Task<IList<PayloadDto>> GetAllAsync(int? skip = null,
int? limit = null,
string? patientId = "",
string? patientName = "");
string? patientId = null,
string? patientName = null,
string? accessionId = null);
new Task<IList<PayloadDto>> GetAllAsync(int? skip = null, int? limit = null);

/// <summary>
Expand All @@ -63,5 +65,7 @@ Task<IList<PayloadDto>> GetAllAsync(int? skip = null,
/// <param name="payload">updated payload.</param>
/// <returns>true if the update is successful, false otherwise.</returns>
Task<bool> UpdateAsyncWorkflowIds(Payload payload);

Task<long> CountAsync(FilterDefinition<Payload> filter);
}
}
16 changes: 12 additions & 4 deletions src/WorkflowManager/Common/Services/PayloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using Monai.Deploy.WorkflowManager.Common.Storage.Services;
using Microsoft.Extensions.Options;
using Monai.Deploy.WorkflowManager.Common.Configuration;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services
{
Expand Down Expand Up @@ -149,10 +150,11 @@ public async Task<Payload> GetByIdAsync(string payloadId)

public async Task<IList<PayloadDto>> GetAllAsync(int? skip = null,
int? limit = null,
string? patientId = "",
string? patientName = "")
string? patientId = null,
string? patientName = null,
string? accessionId = null)
=> await CreatePayloadsDto(
await _payloadRepository.GetAllAsync(skip, limit, patientId ?? string.Empty, patientName ?? string.Empty)
await _payloadRepository.GetAllAsync(skip, limit, patientId, patientName, accessionId)
);

public async Task<IList<PayloadDto>> GetAllAsync(int? skip = null, int? limit = null)
Expand Down Expand Up @@ -193,7 +195,13 @@ private async Task<IList<PayloadDto>> CreatePayloadsDto(IList<Payload> payloads)
return dtos;
}

public async Task<long> CountAsync() => await _payloadRepository.CountAsync();
public async Task<long> CountAsync(FilterDefinition<Payload> filter)
=> await _payloadRepository.CountAsync(filter);


// this has to be here because of the base, but dont use it !
public Task<long> CountAsync(FilterDefinition<PayloadDto>? filter)
=> throw new NotImplementedException();

public async Task<bool> DeletePayloadFromStorageAsync(string payloadId)
{
Expand Down
8 changes: 6 additions & 2 deletions src/WorkflowManager/Common/Services/WorkflowInstanceService.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

using Ardalis.GuardClauses;
using Microsoft.Extensions.Logging;
using Monai.Deploy.Messaging.Events;
using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Exceptions;
using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces;
using Monai.Deploy.WorkflowManager.Common.Contracts.Models;
using Monai.Deploy.WorkflowManager.Common.Database.Interfaces;
using Monai.Deploy.WorkflowManager.Common.Logging;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services
{
Expand Down Expand Up @@ -87,7 +87,11 @@ public async Task UpdateExportCompleteMetadataAsync(string workflowInstanceId, s
await _workflowInstanceRepository.UpdateExportCompleteMetadataAsync(workflowInstanceId, executionId, resultMetadata);
}

public async Task<long> CountAsync() => await _workflowInstanceRepository.CountAsync();
public async Task<long> CountAsync(FilterDefinition<WorkflowInstance>? filter)
{
filter = filter ?? Builders<WorkflowInstance>.Filter.Empty;
return await _workflowInstanceRepository.CountAsync(filter);
}

public async Task<IList<WorkflowInstance>> GetAllAsync(int? skip = null, int? limit = null, Status? status = null, string? payloadId = null)
=> await _workflowInstanceRepository.GetAllAsync(skip, limit, status, payloadId);
Expand Down
4 changes: 3 additions & 1 deletion src/WorkflowManager/Common/Services/WorkflowService.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Monai.Deploy.WorkflowManager.Common.Contracts.Models;
using Monai.Deploy.WorkflowManager.Common.Database.Interfaces;
using Monai.Deploy.WorkflowManager.Common.Logging;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services
{
Expand Down Expand Up @@ -83,7 +84,8 @@ public Task<DateTime> DeleteWorkflowAsync(WorkflowRevision workflow)
return result;
}

public async Task<long> CountAsync() => await _workflowRepository.CountAsync();
public async Task<long> CountAsync(FilterDefinition<WorkflowRevision>? filter)
=> await _workflowRepository.CountAsync(filter ?? Builders<WorkflowRevision>.Filter.Empty);

public async Task<IList<WorkflowRevision>> GetAllAsync(int? skip = null, int? limit = null)
=> await _workflowRepository.GetAllAsync(skip, limit);
Expand Down
5 changes: 3 additions & 2 deletions src/WorkflowManager/Database/Interfaces/IPayloadRepository.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Monai.Deploy.WorkflowManager.Common.Contracts.Models;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Database.Interfaces
{
Expand All @@ -32,7 +33,7 @@ public interface IPayloadRepository
/// <summary>
/// Retrieves a list of payloads in the database.
/// </summary>
Task<IList<Payload>> GetAllAsync(int? skip = null, int? limit = null, string patientId = "", string patientName = "");
Task<IList<Payload>> GetAllAsync(int? skip = null, int? limit = null, string? patientId = null, string? patientName = null, string? accessionId = null);

/// <summary>
/// Retrieves a payload by id in the database.
Expand All @@ -44,7 +45,7 @@ public interface IPayloadRepository
/// Gets count of objects
/// </summary>
/// <returns>Count of objects.</returns>
Task<long> CountAsync();
Task<long> CountAsync(FilterDefinition<Payload> filter);

/// <summary>
/// Updates a payload in the database.
Expand Down
3 changes: 2 additions & 1 deletion src/WorkflowManager/Database/Interfaces/IWorkflowInstanceRepository.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Threading.Tasks;
using Monai.Deploy.Messaging.Events;
using Monai.Deploy.WorkflowManager.Common.Contracts.Models;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Database.Interfaces
{
Expand All @@ -44,7 +45,7 @@ public interface IWorkflowInstanceRepository
/// Gets count of Workflow Instances.
/// </summary>
/// <returns></returns>
Task<long> CountAsync();
Task<long> CountAsync(FilterDefinition<WorkflowInstance> filter);

/// <summary>
/// Gets the count of workflow instances with a filter.
Expand Down
3 changes: 2 additions & 1 deletion src/WorkflowManager/Database/Interfaces/IWorkflowRepository.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Monai.Deploy.WorkflowManager.Common.Contracts.Models;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.Database.Interfaces
{
Expand Down Expand Up @@ -97,7 +98,7 @@ public interface IWorkflowRepository
/// <returns></returns>
Task<DateTime> SoftDeleteWorkflow(WorkflowRevision workflow);

Task<long> CountAsync();
Task<long> CountAsync(FilterDefinition<WorkflowRevision> filter);

Task<IList<WorkflowRevision>> GetAllAsync(int? skip, int? limit);

Expand Down
24 changes: 14 additions & 10 deletions src/WorkflowManager/Database/Repositories/PayloadRepository.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@
}
}

public Task<long> CountAsync() => CountAsync(_payloadCollection, null);
public Task<long> CountAsync(FilterDefinition<Payload> filter)
{
return CountAsync(_payloadCollection, filter);
}

public async Task<bool> CreateAsync(Payload payload)
{
ArgumentNullException.ThrowIfNull(payload, nameof(payload));

Check warning on line 81 in src/WorkflowManager/Database/Repositories/PayloadRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

try
{
Expand All @@ -91,18 +94,19 @@
}
}

public async Task<IList<Payload>> GetAllAsync(int? skip = null, int? limit = null, string? patientId = "", string? patientName = "")
public async Task<IList<Payload>> GetAllAsync(int? skip = null, int? limit = null, string? patientId = null, string? patientName = null, string? accessionId = null)
{
var builder = Builders<Payload>.Filter;
var filter = builder.Empty;
if (!string.IsNullOrEmpty(patientId))
{
filter &= builder.Regex(p => p.PatientDetails.PatientId, new BsonRegularExpression($"/{patientId}/i"));
}
if (!string.IsNullOrEmpty(patientName))
{
filter &= builder.Regex(p => p.PatientDetails.PatientName, new BsonRegularExpression($"/{patientName}/i"));
}
if (!string.IsNullOrEmpty(patientId)) filter
&= builder.Regex(p => p.PatientDetails.PatientId, new BsonRegularExpression($"/{patientId}/i"));

if (!string.IsNullOrEmpty(patientName)) filter
&= builder.Regex(p => p.PatientDetails.PatientName, new BsonRegularExpression($"/{patientName}/i"));

if (!string.IsNullOrWhiteSpace(accessionId)) filter
&= builder.Regex(p => p.AccessionId, new BsonRegularExpression($"/{accessionId}/i"));


return await GetAllAsync(_payloadCollection,
filter,
Expand All @@ -113,7 +117,7 @@

public async Task<Payload> GetByIdAsync(string payloadId)
{
ArgumentNullException.ThrowIfNullOrWhiteSpace(payloadId, nameof(payloadId));

Check warning on line 120 in src/WorkflowManager/Database/Repositories/PayloadRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

var payload = await _payloadCollection
.Find(x => x.PayloadId == payloadId)
Expand All @@ -124,7 +128,7 @@

public async Task<bool> UpdateAsyncWorkflowIds(Payload payload)
{
ArgumentNullException.ThrowIfNull(payload, nameof(payload));

Check warning on line 131 in src/WorkflowManager/Database/Repositories/PayloadRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

public async Task<IList<WorkflowInstance>> GetByWorkflowsIdsAsync(List<string> workflowIds)
{
Guard.Against.NullOrEmpty(workflowIds, nameof(workflowIds));

Check warning on line 63 in src/WorkflowManager/Database/Repositories/WorkflowInstanceRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

try
{
Expand All @@ -80,7 +80,7 @@

public async Task<IList<WorkflowInstance>> GetByPayloadIdsAsync(List<string> workflowIds)
{
Guard.Against.NullOrEmpty(workflowIds, nameof(workflowIds));

Check warning on line 83 in src/WorkflowManager/Database/Repositories/WorkflowInstanceRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

try
{
Expand All @@ -100,7 +100,7 @@

public async Task<bool> CreateAsync(IList<WorkflowInstance> workflowInstances)
{
Guard.Against.NullOrEmpty(workflowInstances, nameof(workflowInstances));

Check warning on line 103 in src/WorkflowManager/Database/Repositories/WorkflowInstanceRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

try
{
Expand Down Expand Up @@ -313,7 +313,10 @@
return workflow;
}

public async Task<long> CountAsync() => await CountAsync(_workflowInstanceCollection, null);
public async Task<long> CountAsync(FilterDefinition<WorkflowInstance> filter)
{
return await CountAsync(_workflowInstanceCollection, filter);
}

public async Task<long> FilteredCountAsync(Status? status = null, string? payloadId = null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@

private async Task EnsureIndex()
{
ArgumentNullException.ThrowIfNull(_workflowCollection, "WorkflowCollection");

Check warning on line 51 in src/WorkflowManager/Database/Repositories/WorkflowRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

var asyncCursor = (await _workflowCollection.Indexes.ListAsync());
var bsonDocuments = (await asyncCursor.ToListAsync());
var indexes = bsonDocuments.Select(_ => _.GetElement("name").Value.ToString()).ToList();

// If index not present create it else skip.
if (!indexes.Any(i => i is not null && i.Equals("AeTitleIndex")))

Check warning on line 58 in src/WorkflowManager/Database/Repositories/WorkflowRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Collection-specific "Exists" method should be used instead of the "Any" extension. (https://rules.sonarsource.com/csharp/RSPEC-6605)
{
// Create Index here

Expand Down Expand Up @@ -95,7 +95,7 @@

public async Task<WorkflowRevision> GetByWorkflowIdAsync(string workflowId)
{
ArgumentNullException.ThrowIfNullOrWhiteSpace(workflowId, nameof(workflowId));

Check warning on line 98 in src/WorkflowManager/Database/Repositories/WorkflowRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

var workflow = await _workflowCollection
.Find(x => x.WorkflowId == workflowId && x.Deleted == null)
Expand All @@ -107,7 +107,7 @@

public async Task<IList<WorkflowRevision>> GetByWorkflowsIdsAsync(IEnumerable<string> workflowIds)
{
Guard.Against.NullOrEmpty(workflowIds, nameof(workflowIds));

Check warning on line 110 in src/WorkflowManager/Database/Repositories/WorkflowRepository.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this argument from the method call; it hides the caller information. (https://rules.sonarsource.com/csharp/RSPEC-3236)

var workflows = new List<WorkflowRevision>();

Expand Down Expand Up @@ -272,7 +272,12 @@
return deletedTimeStamp;
}

public async Task<long> CountAsync() => await _workflowCollection.CountDocumentsAsync(x => x.Deleted == null);
public async Task<long> CountAsync(FilterDefinition<WorkflowRevision> filter)
{
var builder = Builders<WorkflowRevision>.Filter;
filter &= builder.Eq(p => p.Deleted, null);
return await _workflowCollection.CountDocumentsAsync(filter);
}

public async Task<IList<WorkflowRevision>> GetAllAsync(int? skip = null, int? limit = null)
=> await GetAllAsync(_workflowCollection,
Expand Down
32 changes: 29 additions & 3 deletions src/WorkflowManager/WorkflowManager/Controllers/PayloadsController.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces;
using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services;
using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Wrappers;
using MongoDB.Bson;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManager.Common.ControllersShared
{
Expand Down Expand Up @@ -72,11 +74,16 @@ public PayloadsController(
/// <param name="filter">Filters.</param>
/// <param name="patientId">Optional patient Id.</param>
/// <param name="patientName">Optional patient name.</param>
/// <param name="accessionId">Optional accession Id.</param>
/// <returns>paged response of subset of all workflows.</returns>
[HttpGet]
[ProducesResponseType(typeof(PagedResponse<List<Payload>>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetAllAsync([FromQuery] PaginationFilter filter, [FromQuery] string patientId = "", [FromQuery] string patientName = "")
public async Task<IActionResult> GetAllAsync(
[FromQuery] PaginationFilter filter,
[FromQuery] string patientId = null,
[FromQuery] string patientName = null,
[FromQuery] string accessionId = null)
{
try
{
Expand All @@ -88,9 +95,28 @@ public async Task<IActionResult> GetAllAsync([FromQuery] PaginationFilter filter
(validFilter.PageNumber - 1) * validFilter.PageSize,
validFilter.PageSize,
patientId,
patientName);
patientName,
accessionId);

var dataTotal = await _payloadService.CountAsync();
var builder = Builders<Payload>.Filter;
var dbFilter = builder.Empty;

if (!string.IsNullOrEmpty(patientId))
{
dbFilter &= builder.Regex(p => p.PatientDetails.PatientId, new BsonRegularExpression($"/{patientId}/i"));
}

if (!string.IsNullOrEmpty(patientName))
{
dbFilter &= builder.Regex(p => p.PatientDetails.PatientName, new BsonRegularExpression($"/{patientName}/i"));
}

if (!string.IsNullOrWhiteSpace(accessionId))
{
dbFilter &= builder.Regex(p => p.AccessionId, new BsonRegularExpression($"/{accessionId}/i"));
}

var dataTotal = await _payloadService.CountAsync(dbFilter);
var pagedReponse = CreatePagedResponse(pagedData.ToList(), validFilter, dataTotal, _uriService, route);

return Ok(pagedReponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,11 @@ public async Task<IActionResult> GetDailyStatsAsync([FromQuery] TimeFilter filte
TotalApprovals = g.Count(i => string.Compare(i.Status, "Succeeded", true) == 0 && i.Reason == FailureReason.None),
TotalRejections = g.Count(i => string.Compare(i.Status, "Failed", true) == 0 && i.Reason == FailureReason.Rejected),
TotalCancelled = g.Count(i => string.Compare(i.Status, "Failed", true) == 0 && i.Reason == FailureReason.TimedOut),
//TotalAwaitingReview = g.Count(i => string.Compare(i.Status, ApplicationReviewStatus.AwaitingReview.ToString(), true) == 0),

// TotalAwaitingReview = g.Count(i => string.Compare(i.Status, ApplicationReviewStatus.AwaitingReview.ToString(), true) == 0),
TotalAwaitingReview = g.Count(i => string.Compare(i.Status, TaskExecutionStatus.Accepted.ToString(), true) == 0),
});



var pagedStats = statsDto.Skip((filter.PageNumber - 1) * pageSize).Take(pageSize);

var res = CreateStatsPagedResponse(pagedStats, validFilter, statsDto.Count(), _uriService, route);
Expand Down
4 changes: 2 additions & 2 deletions tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@

_payloadRepository.Setup(p =>
p.GetAllAsync(
It.IsAny<int?>(), It.IsAny<int?>(), It.IsAny<string>(), It.IsAny<string>())
It.IsAny<int?>(), It.IsAny<int?>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())
).ReturnsAsync(() => input);
var param = new List<string>() { input.First().Id };
_workflowInstanceRepository.Setup(r =>
Expand Down Expand Up @@ -301,7 +301,7 @@

_payloadRepository.Setup(p =>
p.GetAllAsync(
It.IsAny<int?>(), It.IsAny<int?>(), It.IsAny<string>(), It.IsAny<string>())
It.IsAny<int?>(), It.IsAny<int?>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())
).ReturnsAsync(() => input);
var param = input.Select(i => i.PayloadId).ToList();
_workflowInstanceRepository.Setup(r =>
Expand Down Expand Up @@ -495,7 +495,7 @@

#pragma warning disable CS8604 // Possible null reference argument.
// Arrange
Payload payload = null;

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / scan

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / scan

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

Check warning on line 498 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

// Act & Assert

Expand Down
3 changes: 2 additions & 1 deletion tests/UnitTests/Common.Tests/Services/WorkflowServiceTests.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Monai.Deploy.WorkflowManager.Common.Database.Interfaces;
using Moq;
using Xunit;
using MongoDB.Driver;

namespace Monai.Deploy.WorkflowManger.Common.Tests.Services
{
Expand Down Expand Up @@ -137,7 +138,7 @@ public async Task WorkflowService_DeleteWorkflow_Calls_SoftDelete()
public async Task WorkflowService_Count_Calls_Count()
{
var result = await WorkflowService.CountAsync();
_workflowRepository.Verify(r => r.CountAsync(), Times.Once());
_workflowRepository.Verify(r => r.CountAsync(Builders<WorkflowRevision>.Filter.Empty), Times.Once());
}

[Fact]
Expand Down
Loading
Loading