mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-31 17:24:37 -05:00
Simplify Object Management APIs (#2015)
* unify requests-wip * wip * unify api * fix test * add credential handler * fix credential handler issue. * generic type update * fix scripting for user
This commit is contained in:
@@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.ServiceLayer.Agent;
|
||||
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectManagement;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common;
|
||||
using Moq;
|
||||
@@ -50,17 +50,17 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
||||
{
|
||||
// setup
|
||||
var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync("master", queryTempFile.FilePath);
|
||||
var credential = await SecurityTestUtils.SetupCredential(connectionResult);
|
||||
var credential = await ObjectManagementTestUtils.SetupCredential(connectionResult.ConnectionInfo.OwnerUri);
|
||||
var service = new AgentService();
|
||||
var proxy = AgentTestUtils.GetTestProxyInfo();
|
||||
await AgentTestUtils.DeleteAgentProxy(service, connectionResult, proxy);
|
||||
await AgentTestUtils.DeleteAgentProxy(service, connectionResult, proxy);
|
||||
|
||||
// test
|
||||
await AgentTestUtils.CreateAgentProxy(service, connectionResult, proxy);
|
||||
|
||||
// cleanup
|
||||
await AgentTestUtils.DeleteAgentProxy(service, connectionResult, proxy);
|
||||
await SecurityTestUtils.CleanupCredential(connectionResult, credential);
|
||||
await ObjectManagementTestUtils.CleanupCredential(connectionResult.ConnectionInfo.OwnerUri, credential);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,20 +74,20 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
||||
{
|
||||
// setup
|
||||
var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync("master", queryTempFile.FilePath);
|
||||
var credential = await SecurityTestUtils.SetupCredential(connectionResult);
|
||||
var credential = await ObjectManagementTestUtils.SetupCredential(connectionResult.ConnectionInfo.OwnerUri);
|
||||
var service = new AgentService();
|
||||
var proxy = AgentTestUtils.GetTestProxyInfo();
|
||||
await AgentTestUtils.DeleteAgentProxy(service, connectionResult, proxy);
|
||||
await AgentTestUtils.DeleteAgentProxy(service, connectionResult, proxy);
|
||||
await AgentTestUtils.CreateAgentProxy(service, connectionResult, proxy);
|
||||
|
||||
// test
|
||||
string originalProxyName = proxy.AccountName;
|
||||
proxy.AccountName = proxy.AccountName + " Updated";
|
||||
await AgentTestUtils.UpdateAgentProxy(service, connectionResult, originalProxyName, proxy);
|
||||
await AgentTestUtils.UpdateAgentProxy(service, connectionResult, originalProxyName, proxy);
|
||||
|
||||
// cleanup
|
||||
await AgentTestUtils.DeleteAgentProxy(service, connectionResult, proxy);
|
||||
await SecurityTestUtils.CleanupCredential(connectionResult, credential);
|
||||
await ObjectManagementTestUtils.CleanupCredential(connectionResult.ConnectionInfo.OwnerUri, credential);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,13 +101,13 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
||||
{
|
||||
// setup
|
||||
var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync("master", queryTempFile.FilePath);
|
||||
var credential = await SecurityTestUtils.SetupCredential(connectionResult);
|
||||
var credential = await ObjectManagementTestUtils.SetupCredential(connectionResult.ConnectionInfo.OwnerUri);
|
||||
var service = new AgentService();
|
||||
var proxy = AgentTestUtils.GetTestProxyInfo();
|
||||
|
||||
// test
|
||||
await AgentTestUtils.DeleteAgentProxy(service, connectionResult, proxy);
|
||||
await SecurityTestUtils.CleanupCredential(connectionResult, credential);
|
||||
await ObjectManagementTestUtils.CleanupCredential(connectionResult.ConnectionInfo.OwnerUri, credential);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.ServiceLayer.Agent;
|
||||
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectManagement;
|
||||
using Microsoft.SqlTools.ServiceLayer.Management;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using Moq;
|
||||
@@ -81,7 +81,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
|
||||
return new AgentProxyInfo()
|
||||
{
|
||||
AccountName = "Test Proxy",
|
||||
CredentialName = SecurityTestUtils.TestCredentialName,
|
||||
CredentialName = ObjectManagementTestUtils.TestCredentialName,
|
||||
Description = "Test proxy description",
|
||||
IsEnabled = true
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user