mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Drop job step and Create\Update alert handlers (#636)
* Add Delete Job Step implementation * Update create\update agent alert handlers to use execution handler * Cleanup create/update/delete operator request handlers
This commit is contained in:
@@ -59,6 +59,16 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
||||
};
|
||||
}
|
||||
|
||||
internal static AgentOperatorInfo GetTestOperatorInfo()
|
||||
{
|
||||
return new AgentOperatorInfo()
|
||||
{
|
||||
Id = 10,
|
||||
Name = "Joe DBA",
|
||||
EmailAddress = "test@aol.com"
|
||||
};
|
||||
}
|
||||
|
||||
internal static async Task CreateAgentJob(
|
||||
AgentService service,
|
||||
TestConnectionResult connectionResult,
|
||||
@@ -135,6 +145,62 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
||||
context.VerifyAll();
|
||||
}
|
||||
|
||||
internal static async Task DeleteAgentJobStep(
|
||||
AgentService service,
|
||||
TestConnectionResult connectionResult,
|
||||
AgentJobStepInfo stepInfo)
|
||||
{
|
||||
var context = new Mock<RequestContext<ResultStatus>>();
|
||||
await service.HandleDeleteAgentJobStepRequest(new DeleteAgentJobStepParams
|
||||
{
|
||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||
Step = stepInfo
|
||||
}, context.Object);
|
||||
context.VerifyAll();
|
||||
}
|
||||
|
||||
internal static async Task CreateAgentOperator(
|
||||
AgentService service,
|
||||
TestConnectionResult connectionResult,
|
||||
AgentOperatorInfo operatorInfo)
|
||||
{
|
||||
var context = new Mock<RequestContext<AgentOperatorResult>>();
|
||||
await service.HandleCreateAgentOperatorRequest(new CreateAgentOperatorParams
|
||||
{
|
||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||
Operator = operatorInfo
|
||||
}, context.Object);
|
||||
context.VerifyAll();
|
||||
}
|
||||
|
||||
internal static async Task UpdateAgentOperator(
|
||||
AgentService service,
|
||||
TestConnectionResult connectionResult,
|
||||
AgentOperatorInfo operatorInfo)
|
||||
{
|
||||
var context = new Mock<RequestContext<AgentOperatorResult>>();
|
||||
await service.HandleUpdateAgentOperatorRequest(new UpdateAgentOperatorParams
|
||||
{
|
||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||
Operator = operatorInfo
|
||||
}, context.Object);
|
||||
context.VerifyAll();
|
||||
}
|
||||
|
||||
internal static async Task DeleteAgentOperator(
|
||||
AgentService service,
|
||||
TestConnectionResult connectionResult,
|
||||
AgentOperatorInfo operatorInfo)
|
||||
{
|
||||
var context = new Mock<RequestContext<ResultStatus>>();
|
||||
await service.HandleDeleteAgentOperatorRequest(new DeleteAgentOperatorParams
|
||||
{
|
||||
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
|
||||
Operator = operatorInfo
|
||||
}, context.Object);
|
||||
context.VerifyAll();
|
||||
}
|
||||
|
||||
internal static async Task<AgentAlertInfo[]> GetAgentAlerts(string connectionUri)
|
||||
{
|
||||
var requestParams = new AgentAlertsParams()
|
||||
|
||||
Reference in New Issue
Block a user