Skip to content

Commit

Permalink
Adding integration test for http client.
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Nichols <[email protected]>
  • Loading branch information
Scott Nichols authored and markpeek committed Apr 8, 2019
1 parent 9cc1a4c commit ca65180
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
3 changes: 3 additions & 0 deletions hack/presubmit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ set -o pipefail

# Test everything in pkg and cmd
go test ./pkg/... ./cmd/... -coverprofile cover.out -timeout 15s

# Test everything in test with a slightly longer timeout
go test ./test/... -timeout 60s
11 changes: 0 additions & 11 deletions pkg/cloudevents/transport/http/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ const (
Unknown
)

type Quoting int32

const (
// Unquoted does not use a wrapping for string header values
Unquoted Quoting = iota
// SingleQuoted uses ' for wrapping string header values
SingleQuoted
// DoubleQuoted uses " for wrapping string header values
DoubleQuoted
)

// String pretty-prints the encoding as a string.
func (e Encoding) String() string {
switch e {
Expand Down
29 changes: 0 additions & 29 deletions pkg/cloudevents/transport/http/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,35 +131,6 @@ func WithBinaryEncoding() Option {
}
}

// WithQuotingHeaderMode sets the HTTP binary mode outbound value quote mode.
func WithQuotingHeaderMode(mode Quoting) Option {
return func(t *Transport) error {
if t == nil {
return fmt.Errorf("http quoting header mode option can not set nil transport")
}

t.Quoting = mode
return nil
}
}

// WithUnquotedHeaderValues sets outbound header string quote mode to Unquoted.
func WithUnquotedHeaderValues() Option {
return WithQuotingHeaderMode(Unquoted)
}

// WithUnquotedHeaderValues sets outbound header string quote mode to
// SingleQuoted.
func WithSingleQuoteHeaderValues() Option {
return WithQuotingHeaderMode(SingleQuoted)
}

// WithUnquotedHeaderValues sets outbound header string quote mode to
// DoubleQuoted.
func WithDoubleQuoteHeaderValues() Option {
return WithQuotingHeaderMode(DoubleQuoted)
}

// WithStructuredEncoding sets the encoding selection strategy for
// default encoding selections based on Event, the encoded event will be the
// given version in Structured form.
Expand Down
2 changes: 0 additions & 2 deletions pkg/cloudevents/transport/http/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ type Transport struct {
// The encoding used to select the codec for outbound events.
Encoding Encoding

Quoting Quoting

// DefaultEncodingSelectionFn allows for other encoding selection strategies to be injected.
DefaultEncodingSelectionFn EncodingSelector

Expand Down

0 comments on commit ca65180

Please sign in to comment.