github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/api/cloudcontroller/ccerror/v2_unexpected_response_error_test.go (about) 1 package ccerror_test 2 3 import ( 4 . "code.cloudfoundry.org/cli/api/cloudcontroller/ccerror" 5 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 ) 9 10 var _ = Describe("V2UnexpectedResponseError", func() { 11 It("formats the error", func() { 12 err := V2UnexpectedResponseError{ 13 ResponseCode: 123, 14 V2ErrorResponse: V2ErrorResponse{ 15 Code: 456, 16 Description: "some-error-description", 17 ErrorCode: "some-error-code", 18 }, 19 RequestIDs: []string{ 20 "6e0b4379-f5f7-4b2b-56b0-9ab7e96eed95", 21 "6e0b4379-f5f7-4b2b-56b0-9ab7e96eed95::7445d9db-c31e-410d-8dc5-9f79ec3fc26f", 22 }, 23 } 24 Expect(err.Error()).To(Equal(`Unexpected Response 25 Response code: 123 26 CC code: 456 27 CC error code: some-error-code 28 Request ID: 6e0b4379-f5f7-4b2b-56b0-9ab7e96eed95 29 Request ID: 6e0b4379-f5f7-4b2b-56b0-9ab7e96eed95::7445d9db-c31e-410d-8dc5-9f79ec3fc26f 30 Description: some-error-description`)) 31 }) 32 })