Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnmbond committed Nov 11, 2024
1 parent 94fe6a0 commit 73860e5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
20 changes: 10 additions & 10 deletions LogicMonitor.Api.Test/Resources/ResourceDataSourceInstanceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class ResourceDataSourceInstanceTests(ITestOutputHelper iTestOutputHelper
public async Task GetAllDeviceDataSourceInstancesAsync()
{
var result = await LogicMonitorClient
.GetAllDeviceDataSourceInstancesAsync(WindowsDeviceId, cancellationToken: default)
.GetAllResourceDataSourceInstancesAsync(WindowsDeviceId, cancellationToken: default)
.ConfigureAwait(true);
result.Should().NotBeNull();
}
Expand All @@ -24,7 +24,7 @@ public async Task GetAllDeviceDataSourceInstancesForOneDeviceDataSourceAsync()
.ConfigureAwait(true);

_ = await LogicMonitorClient
.GetAllDeviceDataSourceInstancesAsync(WindowsDeviceId, deviceDataSource.Id, new(), cancellationToken: default)
.GetAllResourceDataSourceInstancesAsync(WindowsDeviceId, deviceDataSource.Id, new(), cancellationToken: default)
.ConfigureAwait(true);
}

Expand All @@ -41,7 +41,7 @@ public async Task OnlyMonitoredInstances()
var deviceDataSource = await LogicMonitorClient
.GetResourceDataSourceByResourceIdAndDataSourceIdAsync(device.Id, dataSource.Id, cancellationToken: default)
.ConfigureAwait(true);
var resourceDataSourceInstances = await LogicMonitorClient.GetAllDeviceDataSourceInstancesAsync(device.Id, deviceDataSource.Id, new Filter<ResourceDataSourceInstance>
var resourceDataSourceInstances = await LogicMonitorClient.GetAllResourceDataSourceInstancesAsync(device.Id, deviceDataSource.Id, new Filter<ResourceDataSourceInstance>
{
Order = new Order<ResourceDataSourceInstance> { Direction = OrderDirection.Asc, Property = nameof(ResourceDataSourceInstance.DisplayName) },
FilterItems =
Expand All @@ -58,7 +58,7 @@ public async Task AddDeviceDataSourceInstance()
{
var resource = await GetWindowsResourceAsync(default)
.ConfigureAwait(true);
var resourceDataSources = await LogicMonitorClient.GetAllDeviceDataSourcesAsync(resource.Id, new Filter<ResourceDataSource>
var resourceDataSources = await LogicMonitorClient.GetAllResourceDataSourcesAsync(resource.Id, new Filter<ResourceDataSource>
{
Skip = 0,
Take = 10,
Expand All @@ -77,11 +77,11 @@ public async Task AddDeviceDataSourceInstance()
};

await LogicMonitorClient
.AddDeviceDataSourceInstanceAsync(resource.Id, resourceDataSources[9].Id, newInstance, default)
.AddResourceDataSourceInstanceAsync(resource.Id, resourceDataSources[9].Id, newInstance, default)
.ConfigureAwait(true);

var datasourceInstances = await LogicMonitorClient
.GetAllDeviceDataSourceInstancesAsync(resource.Id, resourceDataSources[9].Id, new Filter<ResourceDataSourceInstance>()
.GetAllResourceDataSourceInstancesAsync(resource.Id, resourceDataSources[9].Id, new Filter<ResourceDataSourceInstance>()
{
Skip = 0,
Properties = [nameof(ResourceDataSourceInstance.Id), nameof(ResourceDataSourceInstance.DisplayName)]
Expand Down Expand Up @@ -120,7 +120,7 @@ public async Task GetDataPointConfiguration()
{
var device = await GetWindowsResourceAsync(default)
.ConfigureAwait(true);
var deviceDataSources = await LogicMonitorClient.GetAllDeviceDataSourcesAsync(device.Id, new Filter<ResourceDataSource>
var deviceDataSources = await LogicMonitorClient.GetAllResourceDataSourcesAsync(device.Id, new Filter<ResourceDataSource>
{
Skip = 0,
Take = 10,
Expand All @@ -131,7 +131,7 @@ public async Task GetDataPointConfiguration()
}, default).ConfigureAwait(true);

var datasourceInstances = await LogicMonitorClient
.GetAllDeviceDataSourceInstancesAsync(device.Id, deviceDataSources[0].Id, new Filter<ResourceDataSourceInstance>()
.GetAllResourceDataSourceInstancesAsync(device.Id, deviceDataSources[0].Id, new Filter<ResourceDataSourceInstance>()
{
Skip = 0,
Properties = [nameof(ResourceDataSourceInstance.Id), nameof(ResourceDataSourceInstance.DisplayName)]
Expand All @@ -150,7 +150,7 @@ public async Task UpdateDataPointConfig()
{
var device = await GetWindowsResourceAsync(default)
.ConfigureAwait(true);
var deviceDataSources = await LogicMonitorClient.GetAllDeviceDataSourcesAsync(device.Id, new Filter<ResourceDataSource>
var deviceDataSources = await LogicMonitorClient.GetAllResourceDataSourcesAsync(device.Id, new Filter<ResourceDataSource>
{
Skip = 0,
Take = 10,
Expand All @@ -161,7 +161,7 @@ public async Task UpdateDataPointConfig()
}, default).ConfigureAwait(true);

var datasourceInstances = await LogicMonitorClient
.GetAllDeviceDataSourceInstancesAsync(device.Id, deviceDataSources[0].Id, new Filter<ResourceDataSourceInstance>()
.GetAllResourceDataSourceInstancesAsync(device.Id, deviceDataSources[0].Id, new Filter<ResourceDataSourceInstance>()
{
Skip = 0,
Properties = [nameof(ResourceDataSourceInstance.Id), nameof(ResourceDataSourceInstance.DisplayName)]
Expand Down
4 changes: 2 additions & 2 deletions LogicMonitor.Api.Test/Resources/ResourceDataSourceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class ResourceDataSourceTests(ITestOutputHelper iTestOutputHelper, Fixtur
public async Task GetAllDeviceDataSourcesAsync()
{
var deviceDataSources = await LogicMonitorClient
.GetAllDeviceDataSourcesAsync(1765, null, default)
.GetAllResourceDataSourcesAsync(1765, null, default)
.ConfigureAwait(true);
deviceDataSources.Should().NotBeNull();
}
Expand Down Expand Up @@ -50,7 +50,7 @@ public async Task DeviceDataSourceTests2()
public async Task GetDeviceDatasourceData()
{
var deviceDataSources = await LogicMonitorClient
.GetAllDeviceDataSourcesAsync(WindowsDeviceId, null, default)
.GetAllResourceDataSourcesAsync(WindowsDeviceId, null, default)
.ConfigureAwait(true);

var data = await LogicMonitorClient
Expand Down
2 changes: 1 addition & 1 deletion LogicMonitor.Api.Test/Resources/ResourceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ public async Task GetDeviceDataSourceInstanceDataPointConfigurationAsync()
.GetResourceDataSourceByResourceIdAndDataSourceIdAsync(device.Id, dataSource.Id, default);

var deviceDataSourceInstances = await LogicMonitorClient
.GetAllDeviceDataSourceInstancesAsync(device.Id, deviceDataSource.Id, default)
.GetAllResourceDataSourceInstancesAsync(device.Id, deviceDataSource.Id, default)
.ConfigureAwait(true);

var deviceDataSourceInstance = deviceDataSourceInstances.FirstOrDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public async Task CreatePingDataSourceInstanceSdtOnEmptyDeviceGroup()
.ConfigureAwait(true);

var deviceDataSourceInstance = (await LogicMonitorClient
.GetAllDeviceDataSourceInstancesAsync(WindowsDeviceId, deviceDataSource.Id, new(), cancellationToken: default)
.GetAllResourceDataSourceInstancesAsync(WindowsDeviceId, deviceDataSource.Id, new(), cancellationToken: default)
.ConfigureAwait(true))
.Single();

Expand Down
2 changes: 1 addition & 1 deletion LogicMonitor.Api.Test/Settings/NetscanTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task CreateNetscan()
GroupId = netscanGroup.Id.ToString(CultureInfo.InvariantCulture),
SubnetScanRange = subnetScanRange,
ExcludedIpAddresses = excludedIpAddresses,
DiscoveredDeviceRule = new DiscoveredResourceRule
DiscoveredResourceRule = new DiscoveredResourceRule
{
Assignment =
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,4 @@ public class RestAzureResourceLogAnalyticsWorkspacesSource : EventSource
/// </summary>
[DataMember(Name = "schedule")]
public int Schedule { get; set; }

/// <summary>
/// Azure Log Analytics Workspaces Query
/// </summary>
[DataMember(Name = "query")]
public string Query { get; set; } = string.Empty;

/// <summary>
/// Column Instance Name
/// </summary>
[DataMember(Name = "columnInstanceName")]
public string ColumnInstanceName { get; set; } = string.Empty;
}

0 comments on commit 73860e5

Please sign in to comment.