Refactor DEXJob to ProfileJob across the codebase
Renamed namespaces, classes, and commands from `DEXJob` to `ProfileJob` to align with the new "Profiles" context. Updated pipeline behaviors (`CheckQueryExecutionBehavior`, `MainQueryExecutionBehavior`, `ReCRequestExecutionBehavior`) to handle `TriggeringProfileJobCommand`. Refactored unit tests to reflect the new naming convention, including mock setups and assertions. Updated `DtoExtensions` to return `TriggeringProfileJobBatchCommand`. Adjusted queries and dependency injection to use the new `Profiles` namespace. Performed general refactoring to replace all references to "DEXJob" with "ProfileJob" in method names, variables, and documentation for consistency and clarity.
This commit is contained in:
@@ -21,7 +21,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
{
|
||||
private readonly Mock<ISQLExecutor> _mockExecutor;
|
||||
private readonly Mock<IOptions<DexJobOptions>> _mockOptions;
|
||||
private readonly CheckQueryExecutionBehavior<TriggeringDEXJobCommand, Unit> _behavior;
|
||||
private readonly CheckQueryExecutionBehavior<TriggeringProfileJobCommand, Unit> _behavior;
|
||||
private readonly Mock<RequestHandlerDelegate<Unit>> _mockNext;
|
||||
|
||||
public CheckQueryExecutionBehaviorTests()
|
||||
@@ -29,7 +29,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
_mockExecutor = new Mock<ISQLExecutor>();
|
||||
_mockOptions = new Mock<IOptions<DexJobOptions>>();
|
||||
_mockOptions.Setup(o => o.Value).Returns(new DexJobOptions());
|
||||
_behavior = new CheckQueryExecutionBehavior<TriggeringDEXJobCommand, Unit>(_mockExecutor.Object, _mockOptions.Object);
|
||||
_behavior = new CheckQueryExecutionBehavior<TriggeringProfileJobCommand, Unit>(_mockExecutor.Object, _mockOptions.Object);
|
||||
_mockNext = new Mock<RequestHandlerDelegate<Unit>>();
|
||||
_mockNext.Setup(n => n()).ReturnsAsync(Unit.Value);
|
||||
}
|
||||
@@ -38,7 +38,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
public async Task Handle_WithValidCheckQuery_ExecutesSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
var command = new TriggeringDEXJobCommand
|
||||
var command = new TriggeringProfileJobCommand
|
||||
{
|
||||
Job = new ProfileSqlJob { SqlCheckQuery = "SELECT COUNT(*) AS [Return Value] FROM Table" },
|
||||
BatchId = "20260711143025123456"
|
||||
@@ -68,7 +68,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
public async Task Handle_WithPositiveReturnValue_DoesNotThrow(int returnValue)
|
||||
{
|
||||
// Arrange
|
||||
var command = new TriggeringDEXJobCommand
|
||||
var command = new TriggeringProfileJobCommand
|
||||
{
|
||||
Job = new ProfileSqlJob { SqlCheckQuery = "SELECT COUNT(*) AS [Return Value] FROM Table" },
|
||||
BatchId = "20260711143025123456"
|
||||
@@ -96,7 +96,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
public async Task Handle_WithZeroOrNegativeReturnValue_ThrowsDEXJobException(int returnValue)
|
||||
{
|
||||
// Arrange
|
||||
var command = new TriggeringDEXJobCommand
|
||||
var command = new TriggeringProfileJobCommand
|
||||
{
|
||||
Job = new ProfileSqlJob { SqlCheckQuery = "SELECT COUNT(*) AS [Return Value] FROM Table" },
|
||||
BatchId = "20260711143025123456"
|
||||
@@ -122,7 +122,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
public async Task Handle_WithNullCheckQuery_IgnoresByDefault()
|
||||
{
|
||||
// Arrange
|
||||
var command = new TriggeringDEXJobCommand
|
||||
var command = new TriggeringProfileJobCommand
|
||||
{
|
||||
Job = new ProfileSqlJob { SqlCheckQuery = null },
|
||||
BatchId = "20260711143025123456"
|
||||
@@ -157,8 +157,8 @@ namespace ECMJobRunner.Tests.Application
|
||||
};
|
||||
_mockOptions.Setup(o => o.Value).Returns(options);
|
||||
|
||||
var behavior = new CheckQueryExecutionBehavior<TriggeringDEXJobCommand, Unit>(_mockExecutor.Object, _mockOptions.Object);
|
||||
var command = new TriggeringDEXJobCommand
|
||||
var behavior = new CheckQueryExecutionBehavior<TriggeringProfileJobCommand, Unit>(_mockExecutor.Object, _mockOptions.Object);
|
||||
var command = new TriggeringProfileJobCommand
|
||||
{
|
||||
Job = new ProfileSqlJob { SqlCheckQuery = null },
|
||||
BatchId = "20260711143025123456"
|
||||
@@ -181,7 +181,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
{
|
||||
// Arrange
|
||||
var batchId = "20260711143025123456";
|
||||
var command = new TriggeringDEXJobCommand
|
||||
var command = new TriggeringProfileJobCommand
|
||||
{
|
||||
Job = new ProfileSqlJob { SqlCheckQuery = "SELECT COUNT(*) AS [Return Value] FROM Table WHERE BatchId = '#INT#BATCH_ID'" },
|
||||
BatchId = batchId
|
||||
@@ -209,7 +209,7 @@ namespace ECMJobRunner.Tests.Application
|
||||
public async Task Handle_WithNullResult_ThrowsDEXJobException()
|
||||
{
|
||||
// Arrange
|
||||
var command = new TriggeringDEXJobCommand
|
||||
var command = new TriggeringProfileJobCommand
|
||||
{
|
||||
Job = new ProfileSqlJob { SqlCheckQuery = "SELECT COUNT(*) AS [Return Value] FROM Table" },
|
||||
BatchId = "20260711143025123456"
|
||||
|
||||
Reference in New Issue
Block a user