diff --git a/load_balancer_listeners.go b/load_balancer_listeners.go index 1ed7f7e..8c3ca81 100644 --- a/load_balancer_listeners.go +++ b/load_balancer_listeners.go @@ -16,18 +16,18 @@ type LoadBalancerListener struct { TaggedResource // Just use omitempty everywhere. This makes it easy to use restful. Errors // will be coming from the API if something is disabled. - HREF string `json:"href,omitempty"` - UUID string `json:"uuid,omitempty"` - Name string `json:"name,omitempty"` - Pool LoadBalancerPoolStub `json:"pool,omitempty"` - LoadBalancer LoadBalancerStub `json:"load_balancer,omitempty"` - Protocol string `json:"protocol,omitempty"` - ProtocolPort int `json:"protocol_port,omitempty"` - AllowedCIDRs []string `json:"allowed_cidrs,omitempty"` - TimeoutClientDataMS int `json:"timeout_client_data_ms,omitempty"` - TimeoutMemberConnectMS int `json:"timeout_member_connect_ms,omitempty"` - TimeoutMemberDataMS int `json:"timeout_member_data_ms,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` + HREF string `json:"href,omitempty"` + UUID string `json:"uuid,omitempty"` + Name string `json:"name,omitempty"` + Pool *LoadBalancerPoolStub `json:"pool,omitempty"` + LoadBalancer LoadBalancerStub `json:"load_balancer,omitempty"` + Protocol string `json:"protocol,omitempty"` + ProtocolPort int `json:"protocol_port,omitempty"` + AllowedCIDRs []string `json:"allowed_cidrs,omitempty"` + TimeoutClientDataMS int `json:"timeout_client_data_ms,omitempty"` + TimeoutMemberConnectMS int `json:"timeout_member_connect_ms,omitempty"` + TimeoutMemberDataMS int `json:"timeout_member_data_ms,omitempty"` + CreatedAt time.Time `json:"created_at,omitempty"` } type LoadBalancerListenerRequest struct { diff --git a/test/integration/load_balancer_listeners_integration_test.go b/test/integration/load_balancer_listeners_integration_test.go index 89b2f16..e09108a 100644 --- a/test/integration/load_balancer_listeners_integration_test.go +++ b/test/integration/load_balancer_listeners_integration_test.go @@ -51,7 +51,12 @@ func TestIntegrationLoadBalancerListener_CRUD(t *testing.T) { t.Errorf("Error = %#v, expected %#v", loadBalancerListener, expected) } - if poolLbUUID := loadBalancerListener.Pool.UUID; poolLbUUID != pool.UUID { + lbPool := loadBalancerListener.Pool + if lbPool == nil { + t.Errorf("expected lbPool not to be nil, got=%#v", lbPool) + } + + if poolLbUUID := lbPool.UUID; poolLbUUID != pool.UUID { t.Errorf("poolLbUUID \n got=%#v\nwant=%#v", poolLbUUID, pool.UUID) }