Пример #1
0
        public void SetUp()
        {
            _miaEnvConfiguration = new MiaEnvsConfigurationsImpl
            {
                USERID_HEADER_KEY                 = "useridkey",
                USER_PROPERTIES_HEADER_KEY        = "userpropskey",
                GROUPS_HEADER_KEY                 = "groupskey",
                CLIENTTYPE_HEADER_KEY             = "clienttypekey",
                BACKOFFICE_HEADER_KEY             = "backofficekey",
                MICROSERVICE_GATEWAY_SERVICE_NAME = "gateway-name"
            };
            _serviceClientFactory = new ServiceClientFactory(_miaEnvConfiguration);
            var miaHeaders = new HeaderDictionary
            {
                { "useridkey", "_" },
                { "userpropskey", "_" },
                { "groupskey", "_" },
                { "clienttypekey", "_" },
                { "backofficekey", "_" },
                { "gateway-name", "bar" },
            };
            var miaHeadersPropagator = new MiaHeadersPropagator(miaHeaders, _miaEnvConfiguration);

            ServiceClientFactory.SetMiaHeaders(miaHeadersPropagator);
        }
Пример #2
0
        public void TestGetServiceProxyWithoutEnv()
        {
            var configWithoutMsGatewayName = new MiaEnvsConfigurationsImpl
            {
                USERID_HEADER_KEY                 = "useridkey",
                USER_PROPERTIES_HEADER_KEY        = "userpropskey",
                GROUPS_HEADER_KEY                 = "groupskey",
                CLIENTTYPE_HEADER_KEY             = "clienttypekey",
                BACKOFFICE_HEADER_KEY             = "backofficekey",
                MICROSERVICE_GATEWAY_SERVICE_NAME = ""
            };

            var factory = new ServiceClientFactory(configWithoutMsGatewayName);
            var result  = factory.GetServiceProxy(new InitServiceOptions());

            Check.That(result).IsNull();
        }