mapping_resolver_test.go 446 B

1234567891011121314151617181920
  1. package endpoints
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestMappingResolver_TryResolve(t *testing.T) {
  7. regionId := "cn-hangzhou"
  8. productId := "ecs"
  9. endpoint := GetEndpointFromMap(regionId, productId)
  10. assert.Equal(t, "", endpoint)
  11. AddEndpointMapping("cn-hangzhou", "Ecs", "unreachable.aliyuncs.com")
  12. endpoint = GetEndpointFromMap(regionId, productId)
  13. assert.Equal(t, "unreachable.aliyuncs.com", endpoint)
  14. }