diff --git a/client/Antares.Service.Assets.Client/AssetsServiceUserDataClient.cs b/client/Antares.Service.Assets.Client/AssetsServiceUserDataClient.cs index 9ae12bf..e25482f 100644 --- a/client/Antares.Service.Assets.Client/AssetsServiceUserDataClient.cs +++ b/client/Antares.Service.Assets.Client/AssetsServiceUserDataClient.cs @@ -134,6 +134,10 @@ async Task> IAvailableAssetClient.GetAssetIds(string clientId, bool private WatchListDto FromWatchListResponse(WatchList item) { + if (item == null) + return null; + + return new WatchListDto() { Id = item.Id, @@ -146,6 +150,9 @@ private WatchListDto FromWatchListResponse(WatchList item) private WatchList FromWatchListDto(WatchListDto item) { + if (item == null) + return null; + return new WatchList(item.AssetIds, item.Id, item.Name, item.Order, item.ReadOnly); } diff --git a/tests/Lykke.Service.Assets.Tests.ConsoleApp/Program.cs b/tests/Lykke.Service.Assets.Tests.ConsoleApp/Program.cs index 1a92951..778ade2 100644 --- a/tests/Lykke.Service.Assets.Tests.ConsoleApp/Program.cs +++ b/tests/Lykke.Service.Assets.Tests.ConsoleApp/Program.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading; using Antares.Service.Assets.Client; +using Common; using Lykke.Service.Assets.Client; using Microsoft.Extensions.Logging; using Newtonsoft.Json; @@ -56,6 +57,19 @@ static void Main(string[] args) Console.WriteLine(); var assetPairs = client.AssetPairs.GetAll(); Console.WriteLine($"Asset pairs count: {assetPairs.Count}"); + + var clientUsder = new AssetsServiceUserDataClient("nosql.share.svc.cluster.local:5125", + "http://assets.lykke-service.svc.cluster.local"); + clientUsder.Start(); + + var wl = clientUsder.WatchLists + .GetCustomWatchListAsync("fcf49f02-f230-4179-82b6-4d876b0402f9", "f1769fc8-ca6d-4025-a842-515af74e2f6e") + .GetAwaiter() + .GetResult(); + + Console.WriteLine($"Watch list: {wl?.ToJson()}"); + + //GetCustomWatchListAsync } } }