public void DeserializeTokenMessageTest()
        {
            var tokenPath = _mockDataFetcher.Object.GetPathWithReplacements(FileName);

            Assert.IsTrue(!string.IsNullOrEmpty(tokenPath));
            using StreamReader stream = File.OpenText(tokenPath);
            var tokenData = stream.ReadToEnd();

            Assert.IsTrue(!string.IsNullOrEmpty(tokenData));
            var tokenDto = new SDK.Entities.Internal.JsonDeserializer <AccessTokenDTO>().Deserialize <AccessTokenDTO>(tokenData);

            Assert.IsNotNull(tokenDto);
            Assert.IsTrue(!string.IsNullOrEmpty(tokenDto.Access_token));
        }
        public MtsAuthServiceHelper(ISdkConfiguration config = null)
        {
            var newConfig = config ?? MtsSdk.CreateConfigurationBuilder()
                            .SetUsername("username")
                            .SetPassword("password")
                            .SetHost("mtsgate-ci.betradar.com")
                            .SetVirtualHost("/vhost")
                            .SetLimitId(111)
                            .SetBookmakerId(333)
                            .SetAccessToken("erErk34kfErr")
                            .SetCurrency("EUR")
                            .SetNode(10)
                            .SetMtsClientApiHost("https://mts-api-ci.betradar.com/edge/proxy")
                            .SetKeycloakHost("https://mts-auth-ci.betradar.com")
                            .SetKeycloakUsername("keycloackUsername")
                            .SetKeycloakPassword("keycloackPassword")
                            .SetKeycloakSecret("53d342-4a7c-dgdbd23-9e1b-93822f2")
                            .Build();

            var uri = new Uri(newConfig.KeycloakHost + "/auth/realms/mts/protocol/openid-connect/token");

            var mockDataFetcher = new Mock <DataFetcherHelper>();

            mockDataFetcher.Setup(p => p.GetDataAsync(It.IsAny <Uri>())).Returns(new DataFetcherHelper(BuilderFactoryHelper.UriReplacements).GetDataAsync(uri));
            mockDataFetcher.Setup(p => p.PostDataAsync(It.IsAny <Uri>(), It.IsAny <HttpContent>())).Returns(new DataFetcherHelper(BuilderFactoryHelper.UriReplacements).PostDataAsync(uri, null));

            var deserializer = new SDK.Entities.Internal.JsonDeserializer <AccessTokenDTO>();
            var mapper       = new KeycloakAuthorizationMapperFactory();

            var dataProvider = new DataProvider <AccessTokenDTO, KeycloakAuthorization>(
                uri.AbsoluteUri,
                mockDataFetcher.Object,
                mockDataFetcher.Object,
                deserializer,
                mapper);

            _mtsAuthService = new MtsAuthService(dataProvider, newConfig);
        }