Adding
This commit is contained in:
+71
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using LCU.Api.Internal.DispatcherLib.Persistence;
|
||||
namespace LCU.Api.Internal.DispatcherTests.RepositoryTests;
|
||||
|
||||
public class DbContextTestSet
|
||||
{
|
||||
public IReadOnlyCollection<Job> Jobs { get; set; }
|
||||
public IReadOnlyCollection<WorkItem> WorkItems { get; set; }
|
||||
}
|
||||
|
||||
public abstract class DbContextFromJsonTest
|
||||
{
|
||||
public DbContextTestSet GetTestAccounts(string filePath)
|
||||
{
|
||||
var testSet = new DbContextTestSet();
|
||||
|
||||
// Get the absolute path to the JSON file
|
||||
var path = Path.IsPathRooted(filePath)
|
||||
? filePath
|
||||
: Path.GetRelativePath(Directory.GetCurrentDirectory(), filePath);
|
||||
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
throw new ArgumentException($"Could not find file at path: {path}");
|
||||
}
|
||||
|
||||
var fileData = File.ReadAllText(filePath);
|
||||
var allData = JObject.Parse(fileData);
|
||||
|
||||
var data = allData["jobs"];
|
||||
testSet.Jobs = data?.ToObject<List<Job>>();
|
||||
|
||||
var events = allData["workitems"];
|
||||
testSet.WorkItems = events?.ToObject<List<WorkItem>>();
|
||||
|
||||
return testSet;
|
||||
}
|
||||
|
||||
public AppDbContext GetBlankContext()
|
||||
{
|
||||
var options = new DbContextOptionsBuilder<AppDbContext>()
|
||||
.UseInMemoryDatabase(Guid.NewGuid().ToString())
|
||||
.Options;
|
||||
return new AppDbContext(options);
|
||||
}
|
||||
|
||||
public AppDbContext GetContextWithData(string jsonFileName)
|
||||
{
|
||||
var options = new DbContextOptionsBuilder<AppDbContext>()
|
||||
.UseInMemoryDatabase(Guid.NewGuid().ToString())
|
||||
.Options;
|
||||
var context = new AppDbContext(options);
|
||||
|
||||
var testData = GetTestAccounts(jsonFileName);
|
||||
AddTo(context.Jobs, testData.Jobs);
|
||||
AddTo(context.WorkItems, testData.WorkItems);
|
||||
|
||||
context.SaveChanges();
|
||||
context.ChangeTracker.Clear();
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
private static void AddTo<T>(DbSet<T> collection, IEnumerable<T> range) where T : class
|
||||
{
|
||||
if (range != null) collection.AddRange(range);
|
||||
}
|
||||
}
|
||||
+395
@@ -0,0 +1,395 @@
|
||||
using System.Collections.Generic;
|
||||
using LCU.Api.Internal.DispatcherLib.Repositories;
|
||||
using LCU.Library.Internal.DispatcherModels.Enums;
|
||||
using LCU.Library.Internal.DispatcherModels.Constants;
|
||||
namespace LCU.Api.Internal.DispatcherTests.RepositoryTests;
|
||||
|
||||
public class JobRepositoryTest : DbContextFromJsonTest
|
||||
{
|
||||
private readonly JobRepository _jobRepository;
|
||||
|
||||
public JobRepositoryTest()
|
||||
{
|
||||
var dbContext = GetContextWithData("RepositoryTests\\job_repo_basic.json");
|
||||
_jobRepository = new JobRepository(dbContext);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_DefaultFilter()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter();
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(4, resultsBasic.Items.Count());
|
||||
var first = resultsBasic.Items.First();
|
||||
Assert.Equal(1, first.JobId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_OrderbyNextRunTime()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
StatusFilters = null,
|
||||
SortableFields = new List<SortableField>()
|
||||
{
|
||||
new SortableField()
|
||||
{
|
||||
Field = JobSortableFields.NextRunTime,
|
||||
IsDescending = true,
|
||||
Position = 0
|
||||
}
|
||||
}
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(8, resultsBasic.Items.Count());
|
||||
var first = resultsBasic.Items.First();
|
||||
Assert.Equal(3, first.JobId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_OrderbyName()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
|
||||
TagIdFilters = null,
|
||||
StatusFilters = null,
|
||||
SortableFields = new List<SortableField>()
|
||||
{
|
||||
new SortableField()
|
||||
{
|
||||
Field = JobSortableFields.Name,
|
||||
IsDescending = true,
|
||||
Position = 0
|
||||
}
|
||||
}
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(8, resultsBasic.Items.Count());
|
||||
var first = resultsBasic.Items.First();
|
||||
Assert.Equal(1085, first.JobId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_OrderbyDescription()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
|
||||
TagIdFilters = null,
|
||||
StatusFilters = null,
|
||||
SortableFields = new List<SortableField>()
|
||||
{
|
||||
new SortableField()
|
||||
{
|
||||
Field = JobSortableFields.Description,
|
||||
IsDescending = true,
|
||||
Position = 0
|
||||
}
|
||||
}
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(8, resultsBasic.Items.Count());
|
||||
var first = resultsBasic.Items.First();
|
||||
Assert.Equal(1085, first.JobId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_StatusFailed_Return_2()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
StatusFilters = new List<StatusFilter>()
|
||||
{
|
||||
new StatusFilter()
|
||||
{
|
||||
IsEnabled = true,
|
||||
JobStatus = JobStatus.Failed
|
||||
}
|
||||
}
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(0, resultsBasic.Items.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_StatusInactive_Return_2()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
StatusFilters = new List<StatusFilter>()
|
||||
{
|
||||
new StatusFilter()
|
||||
{
|
||||
IsEnabled = true,
|
||||
JobStatus = JobStatus.Inactive
|
||||
}
|
||||
}
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(4, resultsBasic.Items.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListWithPagingAsync_StatusInactive_Return_2()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
Page = 1,
|
||||
Limit = 1,
|
||||
StatusFilters = new List<StatusFilter>()
|
||||
{
|
||||
new StatusFilter()
|
||||
{
|
||||
IsEnabled = true,
|
||||
JobStatus = JobStatus.Inactive
|
||||
}
|
||||
}
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Single(resultsBasic.Items);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_NextRunTimeGreaterThenDate_Return_0()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
NextRuntimeGreaterThanDate = Convert.ToDateTime("8/20/2025")
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Empty(resultsBasic.Items);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_NextRunTimeGreaterThenDate_Return_2()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
NextRuntimeGreaterThanDate = Convert.ToDateTime("1/13/2022")
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(2, resultsBasic.Items.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_TagId2_Return_0()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
TagIdFilters = new List<int> { 2 }
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Empty(resultsBasic.Items);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FilteredListAsync_TagId1_Return_2()
|
||||
{
|
||||
// Act
|
||||
var filter = new Filter()
|
||||
{
|
||||
StatusFilters = null,
|
||||
SortableFields = null,
|
||||
TagIdFilters = new List<int> { 1 }
|
||||
};
|
||||
var resultsBasic = await _jobRepository.FilteredListAsync(filter, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(4, resultsBasic.Items.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void ListAsync_Test()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _jobRepository.ListAsync(10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(9, resultsBasic.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FindAsync_Found()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _jobRepository.FindByIdAsync(1, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(1, resultsBasic.JobId);
|
||||
Assert.NotNull(resultsBasic.WorkItems);
|
||||
Assert.Equal(2, resultsBasic.WorkItems.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FindAsync_Missing()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _jobRepository.FindByIdAsync(1000, 10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.Null(resultsBasic);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void Update_Test()
|
||||
{
|
||||
var foundJob = await _jobRepository.FindByIdAsync(1, 10, 20);
|
||||
Assert.NotNull(foundJob);
|
||||
Assert.Equal("Test.RequestingApplication.1", foundJob.RequestingApplication);
|
||||
|
||||
foundJob.RequestingApplication = "Test.RequestingApplication.3";
|
||||
|
||||
// Act
|
||||
_jobRepository.Update(foundJob);
|
||||
|
||||
//Act / Assert
|
||||
var updatedJob = await _jobRepository.FindByIdAsync(1, 10, 20);
|
||||
Assert.NotNull(updatedJob);
|
||||
updatedJob.RequestingApplication = "Test.RequestingApplication.3";
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void AddAsync_Test()
|
||||
{
|
||||
var jobtag = new Tag();
|
||||
jobtag.TagId = 1;
|
||||
jobtag.TagName = "Reports";
|
||||
// Arrange
|
||||
var job = new Job()
|
||||
{
|
||||
JobId = 100,
|
||||
JobTags = new List<JobTag>()
|
||||
{
|
||||
new JobTag()
|
||||
{
|
||||
JobId = 100,
|
||||
Tag = jobtag,
|
||||
TagId = 1
|
||||
},
|
||||
},
|
||||
|
||||
RequestingApplication = "Test.RequestingApplication.1",
|
||||
WorkItems = new List<WorkItem>()
|
||||
{
|
||||
new WorkItem ()
|
||||
{
|
||||
WorkItemId = 100,
|
||||
JobId = 100,
|
||||
Order = 1,
|
||||
SerializedPayload = "{TEST:null}",
|
||||
Url = "Test.Application.1",
|
||||
HttpMethod = HttpMethodType.Post,
|
||||
},
|
||||
new WorkItem ()
|
||||
{
|
||||
WorkItemId = 200,
|
||||
JobId = 100,
|
||||
Order = 2,
|
||||
SerializedPayload = "{TEST:null}",
|
||||
Url = "Test.Application.21",
|
||||
HttpMethod = HttpMethodType.Post,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Act
|
||||
var resultsBasic = await _jobRepository.AddAsync(job);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.True(resultsBasic.JobId > 0);
|
||||
Assert.True(resultsBasic.JobTags.Count > 0);
|
||||
Assert.NotNull(resultsBasic.WorkItems);
|
||||
Assert.Equal(100, resultsBasic.WorkItems.First().WorkItemId);
|
||||
Assert.Equal(resultsBasic.JobId, resultsBasic.WorkItems.First().JobId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FindJobsReadyToBeScheduled_Return_2()
|
||||
{
|
||||
// Act
|
||||
var date = DateTime.Now;
|
||||
var resultsBasic = await _jobRepository.FindJobsReadyToBeScheduled(date);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(2, resultsBasic.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void ListInactiveAsync_Test()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _jobRepository.ListInactiveAsync(10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(3, resultsBasic.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void ListSoftDeletedAsync_Test()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _jobRepository.ListSoftDeletedTrackedAsync(10, 20, new DateTime(2023, 04, 01));
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Single(resultsBasic);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void ListInactiveExcludeSoftDeletedAsync_Test()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _jobRepository.ListInactiveExcludeSoftDeletedTrackedAsync(10, 20);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(2, resultsBasic.Count());
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
using LCU.Api.Internal.DispatcherLib.Repositories;
|
||||
using LCU.Library.Internal.DispatcherModels.Enums;
|
||||
namespace LCU.Api.Internal.DispatcherTests.RepositoryTests;
|
||||
|
||||
public class WorkItemRepositoryTest : DbContextFromJsonTest
|
||||
{
|
||||
private readonly WorkItemRepository _workItemRepository;
|
||||
|
||||
public WorkItemRepositoryTest()
|
||||
{
|
||||
var dbContext = GetContextWithData("RepositoryTests\\job_repo_basic.json");
|
||||
_workItemRepository = new WorkItemRepository(dbContext);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void ListAsync_Test()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _workItemRepository.ListAsync();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(17, resultsBasic.Count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FindAsync_Found()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _workItemRepository.FindByIdAsync(1);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(1, resultsBasic.WorkItemId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void FindAsync_Missing()
|
||||
{
|
||||
// Act
|
||||
var resultsBasic = await _workItemRepository.FindByIdAsync(1000);
|
||||
|
||||
// Assert
|
||||
Assert.Null(resultsBasic);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void Update_Test()
|
||||
{
|
||||
var foundWorkItem = await _workItemRepository.FindByIdAsync(1);
|
||||
Assert.NotNull(foundWorkItem);
|
||||
Assert.Equal("{TEST1: null}", foundWorkItem.SerializedPayload);
|
||||
|
||||
foundWorkItem.SerializedPayload = "{TEST_New: null}";
|
||||
|
||||
// Act
|
||||
_workItemRepository.Update(foundWorkItem);
|
||||
|
||||
//Act / Assert
|
||||
var updatedWorkItem = await _workItemRepository.FindByIdAsync(1);
|
||||
Assert.NotNull(updatedWorkItem);
|
||||
updatedWorkItem.SerializedPayload = "{TEST_New: null}";
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void AddAsync_Test()
|
||||
{
|
||||
// Arrange
|
||||
var workItem = new WorkItem()
|
||||
{
|
||||
WorkItemId = 100,
|
||||
JobId = 100,
|
||||
Name = "test",
|
||||
Order = 1,
|
||||
SerializedPayload = "{TEST:null}",
|
||||
Url = "Test.Application.1",
|
||||
HttpMethod = HttpMethodType.Post
|
||||
};
|
||||
|
||||
// Act
|
||||
var resultsBasic = await _workItemRepository.AddAsync(workItem);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.True(resultsBasic.WorkItemId > 0);
|
||||
Assert.Equal(1, resultsBasic.Order);
|
||||
Assert.Equal("{TEST:null}", resultsBasic.SerializedPayload);
|
||||
Assert.Equal("Test.Application.1", resultsBasic.Url);
|
||||
Assert.Equal(HttpMethodType.Post, resultsBasic.HttpMethod);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void GetFirstOrDefaultWorkItemByJobId_Found()
|
||||
{
|
||||
// Arrange/Act
|
||||
var resultsBasic = await _workItemRepository.GetFirstOrDefaultWorkItemByJobId(11);
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(resultsBasic);
|
||||
Assert.Equal(211, resultsBasic.WorkItemId);
|
||||
}
|
||||
}
|
||||
+440
@@ -0,0 +1,440 @@
|
||||
{
|
||||
"jobs": [
|
||||
{
|
||||
"JobId": 1,
|
||||
"RequestingApplication": "Test.RequestingApplication.1",
|
||||
"name": "JobName",
|
||||
"description": "description",
|
||||
"createdBy": "Joshua Annear",
|
||||
"NextRunTime": null,
|
||||
"SoftDeleteDate": null,
|
||||
"JobStatus": 1,
|
||||
"WorkItems": [
|
||||
{
|
||||
"WorkItemId": 1,
|
||||
"JobId": 1,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 1,
|
||||
"SerializedPayload": "{TEST1: null}",
|
||||
"Url": "Test.Application.1.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
},
|
||||
{
|
||||
"WorkItemId": 2,
|
||||
"JobId": 1,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 2,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.2.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
}
|
||||
],
|
||||
"JobTags": [
|
||||
{
|
||||
"JobTagId": 1,
|
||||
"JobId": 1,
|
||||
"TagId": 1
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
{
|
||||
"JobId": 2,
|
||||
"RequestingApplication": "Test.RequestingApplication.1",
|
||||
"name": "JobName",
|
||||
"description": "description",
|
||||
"createdBy": "Joshua Annear",
|
||||
"ReceivedTimestamp": "11/30/2020",
|
||||
"NextRunTime": null,
|
||||
"JobStatus": 1,
|
||||
"WorkItems": [
|
||||
{
|
||||
"WorkItemId": 3,
|
||||
"JobId": 2,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 1,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.1.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
},
|
||||
{
|
||||
"WorkItemId": 4,
|
||||
"JobId": 2,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 2,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.2.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"JobId": 3,
|
||||
"RequestingApplication": "Test.RequestingApplication.1",
|
||||
"name": "JobName",
|
||||
"description": "description",
|
||||
"createdBy": "Joshua Annear",
|
||||
"NextRunTime": "8/19/2025",
|
||||
"SoftDeleteDate": null,
|
||||
"JobStatus": 1,
|
||||
"WorkItems": [
|
||||
{
|
||||
"WorkItemId": 5,
|
||||
"JobId": 1,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 1,
|
||||
"SerializedPayload": "{TEST1: null}",
|
||||
"Url": "Test.Application.1.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
},
|
||||
{
|
||||
"WorkItemId": 6,
|
||||
"JobId": 1,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 2,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.2.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
}
|
||||
],
|
||||
"JobTags": [
|
||||
{
|
||||
"JobTagId": 3,
|
||||
"JobId": 3,
|
||||
"TagId": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"JobId": 4,
|
||||
"RequestingApplication": "Test.RequestingApplication.1",
|
||||
"name": "JobName",
|
||||
"description": "description",
|
||||
"createdBy": "Joshua Annear",
|
||||
"NextRunTime": "08/19/2025",
|
||||
"SoftDeleteDate": null,
|
||||
"JobStatus": 1,
|
||||
"WorkItems": [
|
||||
{
|
||||
"WorkItemId": 7,
|
||||
"JobId": 1,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 1,
|
||||
"SerializedPayload": "{TEST1: null}",
|
||||
"Url": "Test.Application.1.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
},
|
||||
{
|
||||
"WorkItemId": 8,
|
||||
"JobId": 1,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 2,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.2.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
}
|
||||
],
|
||||
"JobTags": [
|
||||
{
|
||||
"JobTagId": 4,
|
||||
"JobId": 4,
|
||||
"TagId": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"jobId": 1085,
|
||||
"requestingApplication": "Dispatcher Manager",
|
||||
"name": "test FAIL",
|
||||
"description": "test",
|
||||
"createdBy": "Joshua Annear",
|
||||
"createdAt": "2021-06-09T08:33:21.393",
|
||||
"modifiedBy": "Joshua Annear",
|
||||
"modifiedDate": "2022-01-13T11:05:28.993",
|
||||
"cronSchedule": null,
|
||||
"nextRunTime": "2022-01-13T11:05:56.237",
|
||||
"jobErrorRecipients": [
|
||||
{
|
||||
"jobErrorRecipientId": 4,
|
||||
"jobId": 1085,
|
||||
"recipient": "[email protected]"
|
||||
}
|
||||
],
|
||||
"workItems": [
|
||||
{
|
||||
"workItemId": 1297,
|
||||
"jobId": 1085,
|
||||
"name": "test",
|
||||
"description": "test",
|
||||
"order": 0,
|
||||
"serializedPayload": "{\"SourceDirectory\":\"test\",\"DirectoryName\":\"test\",\"ZipPath\":\"test\",\"ZipFileName\":\"test\",\"FileNameSetting\":{\"DateFormatSettings\":[],\"RegexSettings\":[],\"DaysFromToday\":0},\"DynamicDirectoryName\":\"test\",\"FormattedSourceDirectory\":\"test\\\\\",\"ZipDestination\":\"test\\\\test.zip\",\"ResponseItems\":[{\"ReturnQueueConsumerConfig\":{\"QueueName\":\"LCU.Queue.Dispatcher.Completion\",\"ExchangeName\":\"LCU.Dispatcher.Direct\",\"Subject\":\"LCU.Queue.Dispatcher.Completion\"},\"ReturnQueueConnectionConfig\":{\"Url\":\"localhost\",\"Port\":5672,\"Username\":\"guest\",\"Password\":\"guest\"},\"ResponsePayload\":\"{\\\"WorkItemId\\\":1297}\"}]}",
|
||||
"url": "https://localhost:44326/api/FileOperations/ZipDirectory",
|
||||
"httpMethod": 1,
|
||||
"actionType": 6,
|
||||
"workItemExecutions": [
|
||||
{
|
||||
"workItemExecutionId": 1545,
|
||||
"workItemId": 1297,
|
||||
"status": 1,
|
||||
"startedTimestamp": "2021-06-09T08:34:02.6",
|
||||
"completedTimestamp": "2022-01-13T11:05:56.207",
|
||||
"systemMessage": null,
|
||||
"attemptsToExecute": null
|
||||
},
|
||||
{
|
||||
"workItemExecutionId": 1608,
|
||||
"workItemId": 1297,
|
||||
"status": 3,
|
||||
"startedTimestamp": "2022-01-13T11:06:04.627",
|
||||
"completedTimestamp": null,
|
||||
"systemMessage": "",
|
||||
"attemptsToExecute": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"jobId": 68,
|
||||
"requestingApplication": "Dispatcher Manager",
|
||||
"name": "Rename and Move File",
|
||||
"description": "Rename and Move File",
|
||||
"createdBy": "Joshua Annear",
|
||||
"createdAt": "2021-02-15T14:47:05.93",
|
||||
"modifiedBy": "Joshua Annear",
|
||||
"modifiedDate": "2022-01-13T11:04:39.633",
|
||||
"cronSchedule": "55 * * * *",
|
||||
"nextRunTime": "2022-01-13T11:55:00",
|
||||
"jobErrorRecipients": [],
|
||||
"workItems": [
|
||||
{
|
||||
"workItemId": 278,
|
||||
"jobId": 68,
|
||||
"name": "RenameFile",
|
||||
"description": null,
|
||||
"order": 0,
|
||||
"serializedPayload": "{\"SourcePath\":\"\\\\\\\\zeus\\\\DataIntegrationsQA\\\\Test_FileOperationsApi_Folder_1\",\"SourceFile\":\"Test_New.txt\",\"NewFilename\":\"Test2.txt\",\"SourceNameSetting\":{\"DateFormatSettings\":[],\"RegexSettings\":null,\"DaysFromToday\":0},\"NewNameSetting\":{\"DateFormatSettings\":[],\"RegexSettings\":null,\"DaysFromToday\":0},\"SucceedOnError\":true,\"FinalSourceFile\":\"Test_New.txt\",\"Source\":\"\\\\\\\\zeus\\\\DataIntegrationsQA\\\\Test_FileOperationsApi_Folder_1\\\\Test_New.txt\",\"FinalNewFileName\":\"Test2.txt\",\"NewFilenamePath\":\"\\\\\\\\zeus\\\\DataIntegrationsQA\\\\Test_FileOperationsApi_Folder_1\\\\Test2.txt\",\"ResponseItems\":[{\"ReturnQueueConsumerConfig\":{\"QueueName\":\"LCU.Queue.Dispatcher.Completion\",\"ExchangeName\":\"LCU.Dispatcher.Direct\",\"Subject\":\"LCU.Queue.Dispatcher.Completion\"},\"ReturnQueueConnectionConfig\":{\"Url\":\"localhost\",\"Port\":5672,\"Username\":\"guest\",\"Password\":\"guest\"},\"ResponsePayload\":\"{\\\"WorkItemId\\\":278}\"}]}",
|
||||
"url": "https://localhost:44326/api/FileOperations/RenameFile",
|
||||
"httpMethod": 1,
|
||||
"actionType": 2,
|
||||
"workItemExecutions": [
|
||||
{
|
||||
"workItemExecutionId": 1607,
|
||||
"workItemId": 278,
|
||||
"status": 3,
|
||||
"startedTimestamp": "2021-11-23T13:17:03.343",
|
||||
"completedTimestamp": "2021-11-23T13:21:43.68",
|
||||
"systemMessage": "Request is invalid. Response: File does not exists at path \\\\zeus\\DataIntegrationsQA\\Test_FileOperationsApi_Folder_1\\Test_New.txt \n",
|
||||
"attemptsToExecute": null
|
||||
},
|
||||
{
|
||||
"workItemExecutionId": 1609,
|
||||
"workItemId": 278,
|
||||
"status": 3,
|
||||
"startedTimestamp": "2022-01-13T13:42:06.3",
|
||||
"completedTimestamp": null,
|
||||
"systemMessage": "",
|
||||
"attemptsToExecute": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"workItemId": 1307,
|
||||
"jobId": 68,
|
||||
"name": "test3",
|
||||
"description": null,
|
||||
"order": 1,
|
||||
"serializedPayload": "{\"SourcePath\":\"\\\\\\\\zeus\\\\DataIntegrationsQA\\\\Test_FileOperationsApi_Folder_1\",\"SourceFile\":\"Test2.txt\",\"DestinationPath\":\"\\\\\\\\zeus\\\\DataIntegrationsQA\\\\Test_FileOperationsApi_Folder_2\",\"DestinationName\":\"test3.txt\",\"Overwrite\":false,\"SucceedOnError\":false,\"FileNameSetting\":{\"DateFormatSettings\":[],\"RegexSettings\":[],\"DaysFromToday\":0},\"FinalSourceFile\":\"Test2.txt\",\"FinalDestinationName\":\"test3.txt\",\"Source\":\"\\\\\\\\zeus\\\\DataIntegrationsQA\\\\Test_FileOperationsApi_Folder_1\\\\Test2.txt\",\"Destination\":\"\\\\\\\\zeus\\\\DataIntegrationsQA\\\\Test_FileOperationsApi_Folder_2\\\\test3.txt\",\"ResponseItems\":[{\"ReturnQueueConsumerConfig\":{\"QueueName\":\"LCU.Queue.Dispatcher.Completion\",\"ExchangeName\":\"LCU.Dispatcher.Direct\",\"Subject\":\"LCU.Queue.Dispatcher.Completion\"},\"ReturnQueueConnectionConfig\":{\"Url\":\"localhost\",\"Port\":5672,\"Username\":\"guest\",\"Password\":\"guest\"},\"ResponsePayload\":\"{\\\"WorkItemId\\\":1307}\"}]}",
|
||||
"url": "https://localhost:44326/api/FileOperations/MoveFile",
|
||||
"httpMethod": 1,
|
||||
"actionType": 0,
|
||||
"workItemExecutions": [
|
||||
{
|
||||
"workItemExecutionId": 1601,
|
||||
"workItemId": 1307,
|
||||
"status": 2,
|
||||
"startedTimestamp": "2021-11-23T12:30:26.777",
|
||||
"completedTimestamp": "2021-11-23T13:13:10.357",
|
||||
"systemMessage": "",
|
||||
"attemptsToExecute": null
|
||||
},
|
||||
{
|
||||
"workItemExecutionId": 1604,
|
||||
"workItemId": 1307,
|
||||
"status": 2,
|
||||
"startedTimestamp": "2021-11-23T13:14:20.7",
|
||||
"completedTimestamp": "2021-11-23T13:14:37.663",
|
||||
"systemMessage": null,
|
||||
"attemptsToExecute": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"JobId": 11,
|
||||
"RequestingApplication": "Test.RequestingApplication.1",
|
||||
"name": "JobName",
|
||||
"description": "test",
|
||||
"createdBy": "Joshua Annear",
|
||||
"NextRunTime": "1/1/2023",
|
||||
"WorkItems": [
|
||||
{
|
||||
"WorkItemId": 111,
|
||||
"JobId": 11,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 1,
|
||||
"SerializedPayload": "{TEST1: null}",
|
||||
"Url": "Test.Application.1.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
},
|
||||
{
|
||||
"WorkItemId": 211,
|
||||
"JobId": 11,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 0,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.2.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
}
|
||||
],
|
||||
"JobTags": [
|
||||
{
|
||||
"JobTagId": 111,
|
||||
"JobId": 11,
|
||||
"TagId": 1
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
{
|
||||
"JobId": 21,
|
||||
"RequestingApplication": "Test.RequestingApplication.1",
|
||||
"name": "JobName",
|
||||
"description": "test",
|
||||
"createdBy": "Joshua Annear",
|
||||
"ReceivedTimestamp": "11/30/2020",
|
||||
"NextRunTime": "1/1/2023",
|
||||
"WorkItems": [
|
||||
{
|
||||
"WorkItemId": 321,
|
||||
"JobId": 21,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 1,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.1.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
},
|
||||
{
|
||||
"WorkItemId": 421,
|
||||
"JobId": 21,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 2,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.2.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"JobId": 23,
|
||||
"RequestingApplication": "Test.RequestingApplication.1",
|
||||
"name": "JobName",
|
||||
"description": "test",
|
||||
"createdBy": "Joshua Annear",
|
||||
"ReceivedTimestamp": "11/30/2020",
|
||||
"SoftDeleteDate": "2023-03-06",
|
||||
"NextRunTime": null,
|
||||
"WorkItems": [
|
||||
{
|
||||
"WorkItemId": 456,
|
||||
"JobId": 21,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 1,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.1.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
},
|
||||
{
|
||||
"WorkItemId": 567,
|
||||
"JobId": 21,
|
||||
"name": "test",
|
||||
"Status": "Pending",
|
||||
"StartedTimestamp": "11/30/2020",
|
||||
"CompletedTimestamp": null,
|
||||
"Order": 2,
|
||||
"SerializedPayload": "{TEST:null}",
|
||||
"Url": "Test.Application.2.com/test",
|
||||
"HttpMethod": "Post",
|
||||
"AttemptsToExcute": 0,
|
||||
"ActionType": "MoveFile"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user